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

Remove a StorageValue

yolfran

Mapper-Chibcha
Joined
Jan 14, 2009
Messages
59
Reaction score
0
Location
Bucaramanga-Colombia!!!
I have a question,
.
How can i remove a StorageValue or change for other

I need for mi VIP system ,I have a storage value and when the vip ends I want change the value or remove it,but I dont know.

I was trying something like this:

PHP:
function onLogin(cid)
local premStorage = 35966
        if isVip(cid) == TRUE and getPlayerStorageValue(cid,premStorage)== -1 then
                setPlayerStorageValue(cid, premStorage, 1)
        elseif isVip(cid) == FALSE and getPlayerStorageValue(cid, premStorage) == 1 then
                setPlayerStorageValue(cid, premStorage, -1)
        elseif isVip(cid) == FALSE and getPlayerStorageValue(cid, premStorage) == 1 and getPlayerVocation(cid) > 4 then
                doPlayerSetVocation(cid, getPlayerVocation(cid) -4)
                end
        return TRUE
end

onlogin,I have the funcition Isvip in the lib ,and the code in creaturescripts,but i cant change the storage.
 
Lua:
function onLogin(cid)
local premStorage = 35966
        if getPlayerVipDays(cid) >= 1 then
		setPlayerStorageValue(cid, premStorage, 1)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "welcome vip")
		else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here! Buy VIP on the Site.")
		setPlayerStorageValue(cid, premStorage, -1)
		end
		return true
end
 

Similar threads

Back
Top