- 192
- 32
- Версия MoonLoader
- .026-beta
Нужно что бы при вводе команды /connect ip port подключалось к определённому серверу.
Lua:
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("connect", connect)
wait(-1)
end
function connect(ip, port)
if #ip and #port == 0 then
sampAddChatMessage("укажите аргумент к команде /connect ip port", -1)
else
sampAddChatMessage("Подключаемся к "..ip..":"..port.."", -1)
wait(1000)
sampConnectToServer(ip, port)
end
end