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

[REQUEST] Vip Message Pops Up

theroyal

Wassup :)
Joined
Oct 22, 2009
Messages
372
Reaction score
6
hello i have been trying to search for this script for a long time couldn't find so if someone can give it to me
when a player becomes a vip player a message pops up out of him every couple of second with the word vip and some wierd effect
i think it's creature events type script not sure.
 
So you want a animated text with "vip" above a player every couple of seconds when someone is vip, forever? That would be annoying imo, so I probable don't understand it right.
 
So you want a animated text with "vip" above a player every couple of seconds when someone is vip, forever? That would be annoying imo, so I probable don't understand it right.
]
that's exactly right and i saw handful of servers using it i wouldn't say annoying every 5-7 seconds maybe.
 
Lua:
local config = {
    time = 7, 
    exhaust = {
        storage = 1000,
        time = 8, 
    }
}

local function doText(cid, seconds)
    if seconds <= 0 then
    doSendAnimatedText(getPlayerPosition(cid),"Vip", TEXTCOLOR_LIGHTBLUE)
        return false
    end
    return addEvent(doText, 1000, cid, seconds - 1)
end

function onThink(cid, interval)
    if exhaustion.check(cid, config.exhaust.storage) then        
        return false
    end    
if (getPlayerStorageValue(cid,7001) == 1) then
    doText(cid, config.time)
    exhaustion.set(cid, config.exhaust.storage, config.exhaust.time)
end
    return true
end
 
Last edited:
Lua:
local config = {
    time = 7, 
    exhaust = {
        storage = 1000,
        time = 8, 
    }
}

local function doText(cid, seconds)
    if seconds <= 0 then
    doSendAnimatedText(getPlayerPosition(cid),"Vip", TEXTCOLOR_LIGHTBLUE)
        return false
    end
    return addEvent(doText, 1000, cid, seconds - 1)
end

function onThink(cid, interval)
    if exhaustion.check(cid, config.exhaust.storage) then        
        return false
    end    
if (getPlayerStorageValue(cid,7001) == 1) then
    doText(cid, config.time)
    exhaustion.set(cid, config.exhaust.storage, config.exhaust.time)
end
    return true
end

thank you but can you be more specific like where to put the script and what to put in the xml file unfortunatly i'm not so good at scripting :p so i really need to know where to put it and how.
thanks again i will REP ++
 
Creaturescripts.xml
XML:
<event type="think" name="Name" event="script" value="file.lua"/>

login.lua (under the other registerCreatureEvents)
Lua:
registerCreatureEvent(cid, "Name")

Change the name into a name you want.
Btw, don't test this with a god char, they don't have exhaustion.
 
Last edited:
Creaturescripts.xml
XML:
<event type="think" name="Name" event="script" value="file.lua"/>

login.lua (under the other registerCreatureEvents)
Lua:
registerCreatureEvent(cid, "Name")




Change the name into a name you want.
Btw, don't test this with a god char, they don't have exhaustion.


opened a normal char got vip it's not working i did everything you told me to do any ideas?

here is my creaturescripts.xml:
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
        <event type="think" name="VIP" event="script" value="Vipm.lua"/>
	<event type="login" name="PlayerLogin" event="script" value="login.lua"/>

	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
	<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>

	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
	<event type="kill" name="BountyHunter" script="kill.lua"/>
</creaturescripts>

Vipm.lua is what i called the lua file and VIP is the name i gave it and in my login.lua i put this name with the line you gave me
 
Got any errors? I tested it and it works for 8.54. Also are you sure you put the right storage for vip players?
Else you can maybe better try the script from the link polat posted, probable work better because it's a globalevent.

Also made it with more colour effects, so incase you want to add it to the other script.
Lua:
local colors = {
  TEXTCOLOR_WHITE,
  TEXTCOLOR_ORANGE,
  TEXTCOLOR_GREEN,
  TEXTCOLOR_RED,
  TEXTCOLOR_YELLOW,
  TEXTCOLOR_LIGHTBLUE,
  TEXTCOLOR_BLUE
 }
 
    doSendAnimatedText(getPlayerPosition(cid),"Vip", colors[math.random(1, #colors)])

You can replace the doSendAnimatedText for the line at the bottem, and you can add the colours at the top.
 
Last edited:



gives this error:
[09/06/2012 12:01:35] [Error - GlobalEvent Interface]
[09/06/2012 12:01:35] data/globalevents/scripts/vipEffect.lua:eek:nThink
[09/06/2012 12:01:35] Description:
[09/06/2012 12:01:35] data/globalevents/scripts/vipEffect.lua:4: attempt to call global 'getPlayerVipDays' (a nil value)
[09/06/2012 12:01:35] stack traceback:
[09/06/2012 12:01:35] data/globalevents/scripts/vipEffect.lua:4: in function <data/globalevents/scripts/vipEffect.lua:1>
[09/06/2012 12:01:35] [Error - GlobalEvents::think] Couldn't execute event: vipEffect

i use a vip medal system
 
If you use storage with the vip medal you can replace the if getPlayerVipDays(cid) >= 1 then for: if (getPlayerStorageValue(cid,7001) == 1) then
And use the storage you use for the vip medal.
 
test add this on ur database this is important then the script wont work!


Code:
ALTER TABLE `accounts` ADD
`vipdays` int(11) NOT NULL DEFAULT 0;

and why only not remove all ur vip scripts and use this http://otland.net/f163/best-vip-system-ever-action-movevent-globalevent-71638/


you wont get bugg here im using it its working fine!



tryed it's not working i already added this to mysql before also
putting if (getPlayerStorageValue(cid,7001) == 1) then instead of the other is not working either
and i don't want ot remove my all vip system too risky and i'm not so good in this things :p
 
Does your vip medal use a storage? if so, did you wright the right storage? And also do you get any errors?


when i use your way i don't get any errors but i do not know what storage is i told you i don't know alot in scripting.
cna you tell me what it is?
 
If your vip medal is using a storage, people get a certain storage id. This should be in your vip medal script, and you should also use this id instead of 7001.
The line is saying: if (getPlayerStorageValue(cid,7001) == 1) then, this means: If someone has storage with id 7001 then.
 
Last edited:
If your vip medal is using a storage, people get a certain storage id. This should be in your vip medal script, and you should also use this id instead of 7001.
The line is saying: if (getPlayerStorageValue(cid,7001) == 1) then, this means: If someone has storage with id 7001 then.

yes i'm using a vip medal this is the script:
PHP:
-- Credits StreamSide and Empty
function onUse(cid, item, fromPosition, itemEx, toPosition)

	if getPlayerStorageValue(cid,11551) < 1 then
		if getPlayerLevel(cid) > 1 then
			getPlayerStorageValue(cid, 11551)
			doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED) 
			doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
			setPlayerStorageValue(cid, 11551, (getPlayerStorageValue(cid,11551) + 15))
			doRemoveItem(item.uid, 1)
		else
			doPlayerSendCancel(cid,"You need to be at least level 2 to use this.")
			doRemoveItem(item.uid, 1)
		end
	else
		doPlayerSendCancel(cid,"You are already a donator.")
	end	
return TRUE
end

i used the storage id but still not working :p
 
Back
Top