Relax | Дата: Воскресенье, 29.03.2009, 03:41 | Сообщение # 1 |
Местный
Группа:
I'm V.I.P.
Сообщений: 686
Награды: 5
Город: Los Angeles
Репутация: 56
Замечания: 0%
Статус:
| Команда /goto (Перемещение к выбранному игроку) Code function GotoPlayer(PlayerID,TargetID) if isPlayerConnected(TargetID) == 0 then outputChatBox(PlayerID,"Error: That player is not connected.",255,0,0,255) return end if strval(TargetID) == strval(PlayerID) then outputChatBox(PlayerID,"Error: You can not send this command for himself.",255,0,0,255) return end local X, Y, Z, Interior if TargetID == nil then X, Y, Z = getPlayerPos(PlayerID) Interior = getPlayerInterior(PlayerID) else X, Y, Z = getPlayerPos(TargetID) Interior = getPlayerInterior(TargetID) end if isPlayerInAnyVehicle(PlayerID) == 0 then setPlayerPos(PlayerID,X,Y,Z) else setVehiclePos(getPlayerVehicleID(PlayerID),X,Y,Z) end setP layer Inter ior(P layer ID,Interior) end
addCommand("goto","GotoPlayer") Админ команды * /admin <password> -- Зайти в аккаунт админа. * /kick <PlayerID> -- Выкинуть игрока с сервера. * /ban <PlayerID> -- Забанить игрока с сервера. * /ip <PlayerID> -- Узнать IP адресс данного игрока. * /asay <Message> -- Вывод сообщения от админа. Для того чтобы поставить свой пароль для админ аккаунта нужно: найти Code AdminPass="change_me" и изменить change_me на ваш пароль Скриншоты: Code IsPlayerAdmin = {} AdminPass="change_me" -- This is the password used to login as admin. CHANGE IT!
-- ADMIN LOGIN command function AdminLogin(PlayerID,input) if input ~= AdminPass then outputChatBox(PlayerID,"Error: Invalid administrator password specified!",255,0,0,255) return end
IsPlayerAdmin[PlayerID] = 1 outputChatBox(PlayerID,"You're now logged in as server administrator!",255,255,0,255) end addCommand("admin","AdminLogin")
-- KICK command function KickPlayer(PlayerID,TargetID) if IsPlayerAdmin[PlayerID] == 0 then outputChatBox(PlayerID,"Error: You're not a server administrator.",255,0,0,255) return end if isPlayerConnected(TargetID) == 0 then outputChatBox(PlayerID,"Error: That player is not connected.",255,0,0,255) return end outputChatBox("> Admin " .. getPlayerName(PlayerID) .. " kicked " .. getPlayerName(TargetID),255,255,0,255) kickPlayer(TargetID) end addCommand("kick","KickPlayer")
-- BAN command function BanPlayer(PlayerID,TargetID) if IsPlayerAdmin[PlayerID] == 0 then outputChatBox(PlayerID,"Error: You're not a server administrator.",255,0,0,255) return end if isPlayerConnected(TargetID) == 0 then outputChatBox(PlayerID,"Error: That player is not connected.",255,0,0,255) return end outputChatBox("> Admin " .. getPlayerName(PlayerID) .. " banned " .. getPlayerName(TargetID),255,255,0,255) banPlayer(TargetID) end addCommand("ban","BanPlayer")
-- GETIP command function GetIP(PlayerID,TargetID) if IsPlayerAdmin[PlayerID] == 0 then outputChatBox(PlayerID,"Error: You're not a server administrator.",255,0,0,255) return end if isPlayerConnected(TargetID) == 0 then outputChatBox(PlayerID,"Error: That player is not connected.",255,0,0,255) return end outputChatBox("> " .. getPlayerName(TargetID) .. "'s IP address: " .. getPlayerIP(TargetID),255,255,255,255) end addCommand("ip","GetIP")
-- ADMIN MESSAGE command function AdminMsg(PlayerID,message) if IsPlayerAdmin[PlayerID] == 0 then outputChatBox(PlayerID,"Error: You're not a server administrator.",255,0,0,255) return end if message == nil then outputChatBox(PlayerID,"Syntax: /asay <message>",255,0,0,255) return end outputChatBox("> Admin " .. getPlayerName(PlayerID) .. ": " .. message,36,100,219,255) end addCommand("asay","AdminMsg",1) Затем найдите "function onPlayerConnect(PlayerID)" в Main.lua и добавьте строку ниже: Code IsPlayerAdmin[strval(PlayerID)] = 0 Команда /giveweapon (Команда даёт оружие с параметрами Id оружия и кол-во патронов) Code function GiveWeapon(PlayerID,WeaponID,Ammunition) if WeaponID == nil or Ammunition == nil then outputChatBox(PlayerID,">> Syntax: /weapon <weaponid> <ammo-count>",255,0,0,255) return end wid = strval(WeaponID) amm = strval(Ammunition) givePlayerWeapon(PlayerID,wid,amm) end addCommand("giveweapon","GiveWeapon") Команда /veh (Создание машины возле игрока) Code function Vehc(PlayerID,vehid) local X, Y, Z = getPlayerPos(PlayerID) carid = strval(vehid) if carid == nil then outputChatBox(PlayerID,">> Syntax: /veh <vehid>",255,0,0,255) return end if carid > 129 and carid < 235 then createVehicle(carid,X,Y,Z,180.0,-1,-1) setPlayerPos(PlayerID,X, Y, Z+1); else outputChatBox(PlayerID,"/veh 130 - 235 only!.",255,0,0,255) return end end addCommand("veh","Vehc") Команда /gw (Дать оружие выбраному игроку) Code function GiveWeaponForPlayer(PlayerID,TargetID,WeaponID,Ammunition) senderid = strval(TargetID) wid = strval(WeaponID) amm = strval(Ammunition) if WeaponID == nil or Ammunition == nil or TargetID == nil then outputChatBox(PlayerID,">> Syntax: /gw <playerid> <weaponid> <ammo-count>",255,0,0,255) return end if isPlayerConnected(TargetID) == 0 then outputChatBox(PlayerID,"Error: That player is not connected.",255,0,0,255) return end givePlayerWeapon(senderid,wid,amm) end addCommand("gw","GiveWeaponForPlayer") Команда /repair (Починить и восстановить изначальное состояние машины) Code function RepairVehicle(PlayerID,VehicleID) if isPlayerInAnyVehicle(PlayerID) == 1 then VehicleID = getPlayerVehicleID(PlayerID) repairVehicle(VehicleID) outputChatBox(PlayerID,"You repair vehicle!",255,0,0,255) else outputChatBox(PlayerID,"You must be in vehicle!",255,0,0,255) return end end addCommand("repair","RepairVehicle") Команда /vehcol (Сменить цвет автомобиля) Code function VehCol(VehicleID, Color_1, Color_2) if isPlayerInAnyVehicle(PlayerID) == 1 then if Color_1 == nil or Color_2 == nil then outputChatBox(PlayerID,">> Syntax: /vehcol <color 1[0-255]> <color 2[0-255]>",255,0,0,255) return end color1 = strval(Color_1) color2 = strval(Color_2) local vehid = getPlayerVehicleID (PlayerID) setVehicleColor ( vehid, color1, color2 ) else outputChatBox(PlayerID,"You must be in vehicle!",255,0,0,255) return end end addCommand("vehcol","VehCol") Команда /flip (Перевернуть машину на колёса если она перевернулась на крышу) Code function VehFlip(PlayerID,VehicleID) if isPlayerInAnyVehicle(PlayerID) == 1 then local X, Y, Z = getPlayerPos(PlayerID) VehicleID = getPlayerVehicleID(PlayerID) setVehiclePos(VehicleID,X,Y,Z) else outputChatBox(PlayerID,"You must be in vehicle!",255,0,0,255) return end end addCommand("flip","VehFlip") P.S. у меня ещё много чего, буду дополнять... Все команды можно проверить на сервере tdm.org.ua
Public Enemy: LS-SF-LV Developer && Public Enemy TDM Team Leader #TDM-Community
Сообщение отредактировал Relax - Воскресенье, 29.03.2009, 23:05 |
|
|
|