marszalikusowy
New Member
- Joined
- Jun 5, 2012
- Messages
- 8
- Reaction score
- 0
Hi. I've added a antibot system to my ots but I get this error.
Script:
Please help!
Script:
Code:
-- configs
local mintoanswer = 2 -- minutes to answer anti bot system
local delayAntiBot = 45 -- minutes of delay of delayAntiBot
local maxgroupid = 2 -- groupid higher than this don't have antiBotSystem Activated
local prisionpos = {x=156, y=922, z=7} -- if don't answer, go to this pos
local prisionminutes = 60 -- time inside the prision
local templepos = {x=95, y=117, z=7} -- after the prisionminutes, back to this position (temple is recommended)
-- end configs
-- local variables
local storages = {first_num = 20123, second_num = 20124, result = 20125, answer = 20126, prisioned = 20127, prisiontime = 20128, wrong_answers = 20129}
-- end local variables
function onLogin(cid)
local prisioned = getPlayerStorageValue(cid,storages.prisioned)
if (prisioned == 1) then
local prisiontime = getPlayerStorageValue(cid,storages.prisiontime)
local timenow = os.time()
if (timenow >= prisiontime) then
setPlayerStorageValue(cid,storages.prisiontime,0)
setPlayerStorageValue(cid,storages.prisioned,0)
doTeleportThing(cid, templepos)
else
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
doTeleportThing(cid, prisionpos)
end
end
if (delayAntiBot <= mintoanswer) then
debugPrint("Error! Anti Bot System debugs: variable delayAntiBot need to be higher than mintoanswer.")
else
if (getPlayerGroupId(cid) <= maxgroupid) then
antiBotEvent = addEvent(antiBot,1000,{cid=cid})
else
doPlayerSendTextMessage(cid, 20, "People with group ID higher than ".. maxgroupid .." don't have this system.")
end
end
return TRUE
end
function onLogout(cid)
stopEvent(prisionEvent)
stopEvent(antiBotEvent)
stopEvent(checkAnswerEvent)
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.wrong_answers,0)
return TRUE
end