SA-MP Forums Archive
Score save (help) - 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)
+--- Thread: Score save (help) (/showthread.php?tid=414311)



Score save (help) - Youtube12 - 08.02.2013

Guys my score don't save when I relog in my server, can somebody help me please?


Re: Score save (help) - I3Psychedelic - 08.02.2013

show us ur code ?
And how did u get -1 reputation lol wtf


AW: Score save (help) - Youtube12 - 09.02.2013

Witch code should I show, onplayerdeath?
And idk how I get -1 reputation


Re: Score save (help) - DaRk_RaiN - 09.02.2013

Assuming you use Y_INI, save the player's score when he disconnects, if that doesn't work make a timer.


Re: Score save (help) - S0n1COwnsYou - 09.02.2013

not onplayerdeath,
show "OnPlayerDisconnect"


AW: Score save (help) - Youtube12 - 09.02.2013

Код:
public OnPlayerDisconnect(playerid, reason)
{
  	     new spieler[256];
  	     new string[256];
             GetPlayerName(playerid, player, sizeof(player));
             format(string, sizeof(string), "*** %s [ID: %d] has left the server.", player,playerid);
             SendLanguageMessageToAll(Yellow, string);
	     OnPlayerUpdateAccount(playerid);
	     AccountInfo[playerid][Jail] = 0;
             AccountInfo[playerid][AdminLevel] = 0;
             AccountInfo[playerid][Logged] = 0;
             AccountInfo[playerid][Mute] = 0;
	     AccountInfo[playerid][pInt] = 0;
	     AccountInfo[playerid][pLocal] = 255;
	     AccountInfo[playerid][DBKilled] = 0;
	     AccountInfo[playerid][DMLeft] = 0;
	     AccountInfo[playerid][Score] = 0;
             Drugs[playerid] = 0;
             Hide[playerid] = 0;
             SuperPunch[playerid] = 0;
	     DM[playerid] = 0;
	     DMInvited[playerid] = 0;
             PlayerAFK[playerid] = 0;
	     Spam[playerid] = 0;
	     SpamCMD[playerid] = 0;
	     Spawned[playerid] = 0;
	     PlayerCapital[playerid][Money] = 0;
	return true;
}



Re: Score save (help) - S0n1COwnsYou - 09.02.2013

Try Changing
PHP код:
AccountInfo[playerid][Score] = 0
to
PHP код:
AccountInfo[playerid][Score] = GetPlayerScore(playerid);