Lupoh
Active User
- Joined
- Jul 15, 2009
- Messages
- 121
- Reaction score
- 8
Czy na twoim otsie te? jest pe?no botter?w kt?rzy chc? by? lepsi od innych i u?ywaj? nielegalnych program?w? mo?esz temu zapobiec
wchodzimy w data\globalevents\scripts nast?pnie tworzymy plik i dodajemy:
przyk?ad:
wchodzimy w data\globalevents\scripts nast?pnie tworzymy plik i dodajemy:
nast?pnie dodajemy do globalevents.xmllocal AnswerStor = 14365
local AnswerOK = 14366
function ContinueAFKCheckAction(x)
if isPlayer(x.cid) == TRUE then
local AnswerOKValue = getPlayerStorageValue(x.cid, AnswerOK)
setPlayerStorageValue(x.cid, AnswerStor, 0)
setPlayerStorageValue(x.cid, AnswerOK, 0)
if AnswerOKValue ~= 1 then
doRemoveCreature(x.cid)
end
end
end
function StartAFKCheckAction(x)
if isPlayer(x.cid) == TRUE then
local value1, value2 = math.random(5,20), math.random(5,20)
local Answer = value1 + value2
doPlayerSendTextMessage(x.cid, 22, "" .. value1 .." + " .. value2 .." = ?? <-- Utilixa /responder xx")
setPlayerStorageValue(x.cid, AnswerStor, Answer)
addEvent(ContinueAFKCheckAction, 15 * 1000, {cid = x.cid})
end
end
function onThink(interval, lastExecution)
local PlayersOnline = getPlayersOnline()
for i, pid in ipairs(PlayersOnline) do
local Continue = TRUE
if getCreatureSkullType(pid) > 0 then
local Target = getCreatureTarget(pid)
if Target ~= nil then
if isPlayer(Target) == TRUE then
Continue = FALSE
end
end
elseif getPlayerAccess(pid) >= 3 then
Continue = FALSE
end
if Continue == TRUE then
addEvent(StartAFKCheckAction, 15 * 1000, {cid = pid})
end
end
return TRUE
end
data\talkactions\scripts<globalevent name="Anti AFK Botters" interval="960" script="antiafk.lua"/>
i dodajemy do talkactions.xmllocal AnswerStor = 14365
local AnswerOK = 14366
function onSay(cid, words, param)
if getPlayerStorageValue(cid, AnswerStor) > 0 then
if param == ""..getPlayerStorageValue(cid, AnswerStor).."" then
setPlayerStorageValue(cid, AnswerOK, 1)
doPlayerSendTextMessage(cid,22,"Correct!.")
else
doPlayerSendCancel(cid, "Error!.")
end
else
doPlayerSendCancel(cid, "No question done yet.")
end
return TRUE
end
Skrypt dzia?a na zasadzie, wyskakuj? kod kt?ry trzeba wpisa? aby nas nie wyrzuci?o z tibi.<talkaction words="/answer" script="antiafk.lua" />
przyk?ad:
My?l? ?e skrypt si? przyda, je?li nie b?dzie co? dzia?a?o pisa? PW lub w po?cie/answer KOD