script_author("4el0ve4ik")
require "lib.moonloader"
require "lib.sampfuncs"
local resogran = false
function onReceiveRpc(id, bs)
if id == 91 then
if resogran then
return false
end
end
end
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then
print("SAMP или SAMPFUNCS не загружены. Скрипт остановлен.")
return
end
sampRegisterChatCommand("ogran", ebyogran)
sampRegisterRpcHandler(91, onReceiveRpc)
while true do
wait(0)
if not isGameRunning() then
break
end
end
sampUnregisterRpcHandler(91)
end
function ebyogran()
resogran = not resogran
local state = resogran and "включено" or "выключено"
sampAddChatMessage("Ограничение " .. state, -1)
end