villelagui
C++ Programmer
So, i got this script , already configured everything and it's working great, however i wanted to add an exception, for when the player is in protected zone the script wont affect them...
Here's the script:
As you can see here there's an exception that's almost like the one i want, that is to check if player is pzlocked or not, wanted to add another one to check if player is in safe zone...
Here's the script:
Lua:
function onThink(interval, lastExecution)
for x=1,#getOnlinePlayers() do
if getPlayerAccess(getCreatureByName(getOnlinePlayers()[x])) < 4 and (not isPlayerPzLocked(getCreatureByName(getOnlinePlayers()[x]))) and getOnlinePlayers()[x] ~= "Account Manager" then
if getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9564) == -1 then
local numero = math.random(0,99999)
doPlayerSendTextMessage(getCreatureByName(getOnlinePlayers()[x]), MESSAGE_STATUS_WARNING, 'Anti-bot system by Villela. Seu número de confirmação anti-bot é: '..numero..'. Por favor digite !anthaab XXXXX onde XXXXX é seu número de confirmação.')
setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9564,numero)
elseif getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565) == -1 then
setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565,1)
doPlayerSendTextMessage(getCreatureByName(getOnlinePlayers()[x]), MESSAGE_STATUS_WARNING, 'Último aviso. Confirme seu número gerado pelo sistema anti-bot pelo comando !anthaab ou você será banido.')
elseif getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565) == 1 then
doAddAccountBanishment(getAccountIdByName(getOnlinePlayers()[x]))
setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565,-1)
doRemoveCreature(getCreatureByName(getOnlinePlayers()[x]))
end
end
end
return TRUE
end
As you can see here there's an exception that's almost like the one i want, that is to check if player is pzlocked or not, wanted to add another one to check if player is in safe zone...
Lua:
if getPlayerAccess(getCreatureByName(getOnlinePlayers()[x])) < 4 and (not isPlayerPzLocked(getCreatureByName(getOnlinePlayers()[x]))) and getOnlinePlayers()[x] ~= "Account Manager" then