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

If VIP change the name !!!

ninexin

insane.sytes.net
Joined
Jun 10, 2007
Messages
213
Reaction score
3
Location
Brazil
I need a script to change the name of the player when he is VIP, and change again when you finish the VIP

EX:


Uploaded with ImageShack.us

PLxx i need so much i give REP ++ for this !!
 
LUA:
local storage = VIP STORAGE
function onLogin(cid)
	if getCreatureStorage(cid, storage) > 0 then
		db.executeQuery("UPDATE `players` SET `name` = '[VIP]" .. getCreatureName(cid) .. "' WHERE `id` = " .. getPlayerGUID(cid))
	else
		db.executeQuery("UPDATE `players` SET `name` = " .. getCreatureName(cid) .. " WHERE `id` = " .. getPlayerGUID(cid))
	end
	
	return true
end
 
In creaturescripts/scripts/login.lua after function onLogin(cid) add:
LUA:
        registerCreatureEvent(cid, "VipStatus")


In creaturescripts/scripts create vipstatus.lua and add:
LUA:
local storage = VIP STORAGE
function onLogin(cid)
	if getCreatureStorage(cid, storage) > 0 then
		db.executeQuery("UPDATE `players` SET `name` = '[VIP]" .. getCreatureName(cid) .. "' WHERE `id` = " .. getPlayerGUID(cid))
	else
		db.executeQuery("UPDATE `players` SET `name` = " .. getCreatureName(cid) .. " WHERE `id` = " .. getPlayerGUID(cid))
	end
 
	return true
end

in creaturescripts/creaturescripts.xml add:
LUA:
	<event type="login" name="VipStatus" script="vipstatus.lua"/>



----
repp++
 
I have this problem how do I fix it??
I use tfs 0.2.10

Code:
[25/02/2011 15:51:02] Warning: [Event::checkScript] Can not load script. /scripts/vipstatus.lua
[25/02/2011 15:51:02] data/creaturescripts/scripts/vipstatus.lua:2: '=' expected near 'function'
 
Back
Top