• 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!

name [VIP]

GODPaaulo

New Member
Joined
Jun 3, 2011
Messages
64
Reaction score
0
OTServ I have a system that when buying a vip player automatically changes its name to [VIP] Name.
So that when the ends and the player's VIP system will remove the name of this error if someone created an equal interval.
How do I do not chars player with the old name of the VIP?

vipname.lua

Lua:
function pegarNome(name)
return string.sub(name, 7)
end

function onLogin(cid) 
local name = getCreatureName(cid)
local nome = getPlayerGUID(cid)

if isVip(cid) then
if string.sub(name, 1,6) == "[VIP] " then
return true
else
db.query("UPDATE `players` SET `name` = '[VIP] "..name.."' WHERE `id`= " .. nome .. ";")
doPlayerSendTextMessage(cid,19,"You go kicked in 10 seconds for update you name.")
addEvent(doRemoveCreature,10000,cid)
end
else
if string.sub(name, 1,6) == "[VIP] " then
db.query("UPDATE `players` SET `name` = '"..pegarNome(getCreatureName(cid)).."' WHERE `id`= " .. nome .. ";")
doPlayerSendTextMessage(cid,19,"You go kicked in 10 seconds for update you name.")

addEvent(doRemoveCreature,10000,cid)
end

end
return true
end
 
Back
Top