• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua GlobalEvent for remove VIP Days

_Aion_

Nothing Else
Joined
Jan 19, 2010
Messages
401
Solutions
4
Reaction score
10
Location
Jequie,Bahia,Brazil
Hello, i'm making one script that remove VIP Days and [VIP] from name of player.
but i dont know what is wrong.
this is my code
Code:
function onTime()
if string.find(tostring(getCreatureName(cid)),"[[VIP]]") and getPlayerVipDays(cid) == 0 then

db.executeQuery("UPDATE `players` SET `name` = '"..string.sub(getCreatureName(cid), 7).."' WHERE `id` = "..getPlayerGUID(cid)..";")
db.executeQuery("UPDATE players SET vipdays = vipdays - 1 WHERE vipdays > 0;")
print("VIP's Removidas com Sucesso!!")
end
return true
end

Dont remove and give error.

(LuaInterface::internalGetPlayerInfo) Player not found when requesting player info #18

Is for remove from players offline, but i tried all and no sucess :(
 
Code:
function onTime()
for _, cid in ipairs(getPlayersOnline()) do

if string.find(tostring(getCreatureName(cid)),"[[VIP]]") and getPlayerVipDays(cid) == 0 then

db.executeQuery("UPDATE `players` SET `name` = '"..string.sub(getCreatureName(cid), 7).."' WHERE `id` = "..getPlayerGUID(cid)..";")
db.executeQuery("UPDATE players SET vipdays = vipdays - 1 WHERE vipdays > 0;")
print("VIP's Removidas com Sucesso!!")
end
end
return true
end
 
Back
Top