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

Which one?

mpa

Member
Joined
Oct 8, 2008
Messages
319
Reaction score
13
Location
Sweden
Which one is correct?

PHP:
if getPlayerStorageValue(cid, 8899) == TRUE
or
PHP:
if getPlayerStorageValue(cid) == 8899
 
Or..

Code:
[COLOR="Navy"][COLOR="DarkGreen"]if[/COLOR][COLOR="DarkGreen"]([/COLOR]getPlayerStorageValue[COLOR="DarkGreen"]([/COLOR]cid[COLOR="DarkGreen"][COLOR="DarkGreen"],[/COLOR][/COLOR] 8899[COLOR="DarkGreen"])[/COLOR] [COLOR="DarkGreen"]==[/COLOR] 1[COLOR="DarkGreen"])[/COLOR] [COLOR="DarkGreen"]==[/COLOR] [COLOR="DarkGreen"]TRUE [COLOR="DarkGreen"]then[/COLOR][/COLOR][/COLOR]
 
#up

It's unnecessary :p
Code:
if getPlayerStorageValue(cid, 8899) == 1 then
It would be work.

#mpa: TRUE = 1
You can check for 2,3,4... etc. etc. numbers so you should use just 1 instead of TRUE :p
 
When you set storage values you set an ID and a value like this

PHP:
setPlayerStorageValue(1000, 1)

When you want to recall that storage value you do it like this

PHP:
if getPlayerStorageValue(1000) == 1 then
 
It can be LUA_ERROR = -1 too :)
That means the record with typed storage isn't created.
I know that ~= means not equal.
Probably
Code:
if(getPlayerStorageValue(cid, 8899) > FALSE) then
would be the better.
 
Last edited:
Back
Top