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

Checking storage in script

Sorbal

Member
Joined
Jul 23, 2010
Messages
406
Reaction score
11
Location
Poland
Hello Otlanders, i need support from You.. I have this script:
PHP:
function onUse(cid, item, frompos, item2, topos)
    if (getPlayerPromotionLevel(cid) == 0) then
        doPlayerSetPromotionLevel(cid, 1)
		doRemoveItem(item.uid, 1)
		doCreatureSay(cid, "Congratulations! You promoted!", TALKTYPE_ORANGE_1)
		doSendMagicEffect(getPlayerPosition(cid), 49)
    else
		doPlayerSendCancel(cid, "You are already promoted or you don't have vip account")
    end
	return true
end
and i want to this script checks
PHP:
getPlayerStorageValue(cid,11552)
before the script give us promotion. Thanks ^_^
 
Btw, sorry I bumped the thread with my script. I just had this side open for hours while I was playing LoL. After that I made the script and then I saw someone had already made it for you :p
 
It wasn't a mistake. I assumed that the value was a day, so less than 1 day, should be < 1.

It should be ">" instead of "<" anyway xD

"> 0" not "< 1"

I think I don't need to explain anymore, becouse I know that you can script well and scripters can make misstakes sometimes :D
 
Ah, sorry bro. I saw that you made:
Lua:
if(getPlayerStorageValue(cid, s) < 1) then
doPlayerSendCancel(cid, "no vip")
end
I thought:
Lua:
if(getPlayerStorageValue(cid, s) > 0 then
...
else
...
end
Sorry bro.
 

Similar threads

Back
Top