What's new

Anty-AFK!

Status
Not open for further replies.

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:
local 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
nast?pnie dodajemy do globalevents.xml
<globalevent name="Anti AFK Botters" interval="960" script="antiafk.lua"/>
data\talkactions\scripts
local 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
i dodajemy do talkactions.xml
<talkaction words="/answer" script="antiafk.lua" />
Skrypt dzia?a na zasadzie, wyskakuj? kod kt?ry trzeba wpisa? aby nas nie wyrzuci?o z tibi.
przyk?ad:
/answer KOD
My?l? ?e skrypt si? przyda, je?li nie b?dzie co? dzia?a?o pisa? PW lub w po?cie:)
 

rudy409

User
Joined
Apr 30, 2008
Messages
26
Reaction score
0
Odp: Anty-AFK!

dobry skrypt u mnie wszystko gra git ocena 9/10
 
Status
Not open for further replies.
Top