Saving Kills/deaths Issue
#1

Hello,

I have a problem in my script.It doesnt saves players kills and deaths when they disconnect or server gets restart.
It shows 0 kills and deaths when they come again i want it to save anyone please help.

Код:
public OnPlayerDisconnect(playerid, reason)
{

	#if Leavemessages
	new PlayerName[30], string[256];
	switch (reason)
	{
 		case 0:
    	{
			GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			format(string, 256, "%s has left the server (Timeout)", PlayerName);
			SendClientMessageToAll(leavemessagecolor, string);
		}
		case 1:
 		{
			GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			format(string, 256, "%s has left the server (Leaving)", PlayerName);
			SendClientMessageToAll(leavemessagecolor, string);
		}
		case 2:
	 	{
			GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			format(string, 256, "%s has left the server (Kicked/banned)", PlayerName);
			SendClientMessageToAll(leavemessagecolor, string);
		}
	}

	   TextDrawHideForPlayer(playerid,TotalStats[playerid]);

  PlayerInfo[playerid][pDeaths]=0;
  PlayerInfo[playerid][pKills]=0;


	#endif
}
Please anyone fix it !
Reply
#2

Maybe because you set the values to 0 upon disconnect?

PHP код:
  PlayerInfo[playerid][pDeaths]=0;
  
PlayerInfo[playerid][pKills]=0
Remove it...
Reply
#3

OnPlayerDeath -

pawn Код:
PlayerInfo[killerid][pKills]++;
    PlayerInfo[playerid][pDeaths]++;
This will give the person their kill or death

and

pawn Код:
PlayerInfo[playerid][pDeaths]=0;
  PlayerInfo[playerid][pKills]=0;
??

Post your files - for like registered users example;

pawn Код:
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]
If you even have it which you should do as your character should be saved.
Reply
#4

Still 0 Anyone help plz
Reply
#5

Read the above - which I posted.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)