SA-MP Forums Archive
Saving varables. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Saving varables. (/showthread.php?tid=78994)



Saving varables. - Hot - 24.05.2009

I have my own registration and login system, and I want to save some variables like,

HaveBomb[MAX_PLAYERS];

HaveBomb checks if someone have a a bomb, and when the player exit save it, like:

I buyed a bomb, than I exit and when I turn my self online again, the bomb still there.

Take a look at my Registration and Login system:

http://pawn.pastebin.com/m6d62618


Re: Saving varables. - Weirdosport - 24.05.2009

So what's the problem? You don't know how? You do it the same as you save all your other variables.

dUserSetINT(PlayerName(playerid)).("bomb",HaveBomb[playerid]);

That will save the HaveBomb value for the playerid to his file when he disconnected.

EDIT: to get the variable back:

HaveBomb[playerid] = dUserINT(PlayerName(playerid)).("bomb");


Re: Saving varables. - Hot - 24.05.2009

just that? '_'


Re: Saving varables. - Weirdosport - 24.05.2009

Yes, dudb does a lot of the work for you.