Saving - 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 (
/showthread.php?tid=80838)
Saving -
cigo - 06.06.2009
I' ve now finished with levels, but when i left the server and next time i joining the server my level is 0...
How to make them saving?
Re: Saving -
Futurezx - 06.06.2009
Do you have a register sytem? if you have that your stats will be saved
Re: Saving -
Correlli - 06.06.2009
What are you using? Dini/dudb? Or maybe saving system like Godfather has with .ini files, or maybe something else?
Re: Saving -
cigo - 06.06.2009
I have ladmin what is for administrators register/login and property system with register/login for players
Re: Saving -
Correlli - 06.06.2009
Then ask in LAdmin topic.
Re: Saving -
M4S7ERMIND - 06.06.2009
I think Ladmin is using dudb, so heres what you need to do.
Код:
OnPlayerDisconnect(playerid) {
if(PlayerInfo[playerid][LoggedIn] == 1) dUserSetINT(PlayerName(playerid)).("AdminLevel", PlayerInfo[playerid][Level]);
return 1;
}
Put the code below where player logins
Код:
PlayerInfo[playerid][Level] = (dUserINT(PlayerName(playerid)).("AdminLevel"));
Re: Saving -
cigo - 06.06.2009
but levels are located in my gamemode... if i buy example level 1, i left server, next time i join server i have to buy level 1 again.
(i am not talking about admin levels, but i have player levels - if player have, example, buys level 1, he can use command like /healme ,but other players with player level 0 can't use the command!
Re: Saving -
cigo - 06.06.2009
can someone help?
edit: sorry for double post
Re: Saving -
M4S7ERMIND - 06.06.2009
I suggest you to move all your levels to ladmin. And then do like I said before but instead of "PlayerInfo[playerid][Level]" you put your levels.
I suppose you made it like this
Код:
new level[MAX_PLAYERS];
so you replace this
Код:
dUserSetINT(PlayerName(playerid)).("Levels", PlayerInfo[playerid][Level]);
PlayerInfo[playerid][Level] = (dUserINT(PlayerName(playerid)).("Levels"));
with this
Код:
dUserSetINT(PlayerName(playerid)).("Levels", level[playerid]);
level[playerid] = (dUserINT(PlayerName(playerid)).("Levels"));
OnPlayerConnect
Код:
level[playerid] = 0;
Re: Saving -
cigo - 06.06.2009
you didn't understand - ladmin's register and login is for admins only - i've got property system with register and login for players!
so i can't copy my levels to ladmin, also i use strcmp, butin ladmin there is dcmd commands!
edit: i can put levels in my property system, what code then i have to use to save levels?