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

GlobalEvent Vip System

I got this errors by using the vip medal! Please fixx them for me :(

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getCreatureName(cid)
    -- 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 for 25 days! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
            doBroadcastMessage("CONGRATULATIONS " ..  name .. "! Now you are VIP for 25 days! Now you can enter the VIP-area and use unique features!")
            setPlayerStorageValue(cid, 11551, (getPlayerStorageValue(cid,11551) + 25))
            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


:huh::huh::huh:


Well btw! Im using this medal and I get a message Welcome! And this long sentence :p Well only this is working -.- but hey if Im using the vip medal I cant go trough the door! -.-

Another bug: How can I make that the medal is not unlimited?
Im using it and hmmm ... its for ever -.-!

Please help me fast!

-Edit: Btw. Im using TFS 0.2.2 (MS)



I've fixed it :D

New vip.lua script for 0.2.2

PHP:
-- Credits StreamSide, Empty and Kaorus
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getCreatureName(cid)
    -- 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 for 15 days! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
            setPlayerStorageValue(cid, 11551, (getPlayerStorageValue(cid,11551) + 15))
				doPlayerRemoveItem(cid, 5785, 1)
        else
            doPlayerSendCancel(cid,"You need to be at least level 2 to use this.")
        end
    -- else
    --    doPlayerSendCancel(cid,"You are already a donator.")
    -- end    
return TRUE
end
 
Hello! I heve this error:
Code:
[16/10/2009 21:19:30] Lua Script Error: [GlobalEvent Interface] 
[16/10/2009 21:19:30] data/globalevents/scripts/vip/removevipdays.lua:onThink

[16/10/2009 21:19:30] luaGetPlayerStorageValue(). Player not found

[16/10/2009 21:19:30] Lua Script Error: [GlobalEvent Interface] 
[16/10/2009 21:19:30] data/globalevents/scripts/vip/removevipdays.lua:onThink

[16/10/2009 21:19:30] data/globalevents/scripts/vip/removevipdays.lua:7: attempt to perform arithmetic on a boolean value
[16/10/2009 21:19:30] stack traceback:
[16/10/2009 21:19:30] 	data/globalevents/scripts/vip/removevipdays.lua:7: in function <data/globalevents/scripts/vip/removevipdays.lua:3>
[16/10/2009 21:19:30] [Error - GlobalEvents::think] Couldn't execute event: checkvip

I use TFS 0.3.5pl1
 
Does this work perfectly for.. 0.3.5?:)

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local Vip = {
		s = 43510, -- Storage
		d = 30 -- Days
	}
	if(getPlayerStorageValue(cid, Vip.s) < 1) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORKS)
		setPlayerStorageValue(cid, Vip.s, (getPlayerStorageValue(cid, Vip.s) + Vip.d))
		doCreatureSay(cid, "You are now a VIP member.", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid)
	else
		doPlayerSendCancel(cid, "You are already a VIP member.")
		doSendMagicEffect(getCreaturePosition(cid, CONST_ME_POFF)
	end
	return true
end
 
Added, and working 100% perfect!

But I've got a php problem, when someone searchs on the website for a character, and that character IS NOT a vip player, it appears anyway as a "vip" player

how can I fix it?
 
could we do something for when we enter to the game, the console say
"You have xxx days left"

thanks
 
I have this script in my ot. now i need the talkaction !removevipdays <nick> <days> etc..u know about i'm talkin
 

Similar threads

Back
Top