OnPlayerDeath on /stats
#1

Can someone help me with the on player death section? I have a /stats command that is meant to show the deaths but it doesn't! Please can you help?

OnPlayerDeath line:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
 	if(killerid != INVALID_PLAYER_ID)
    {
        PlayerInfo[killerid][pKills]++;
    }
    PlayerInfo[playerid][pDeaths]++;
    return 1;
}
command(stats-... line:
Код:
command(stats, playerid, params[])
{
	new string[128];
	SendClientMessage(playerid, COLOR_ORANGE, ". : : Statistics : : .");
	format(string, sizeof(string), "| Cash: $%d | Kills: %dK | Deaths: %dD |", PlayerInfo[playerid][pCash], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths]);
	SendClientMessage(playerid, SERVERCOLOR, string);
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		format(string, sizeof(string), "| Admin Level: %d | Helper Level: %d |", PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pHelper]);
		SendClientMessage(playerid, SERVERCOLOR, string);
	}
	return 1;
}
Reply
#2

printf(%d,PlayerInfo[playerid][pKills]);
and show the result plz
Reply
#3

Quote:
Originally Posted by StreetRP
Посмотреть сообщение
printf(%d,PlayerInfo[playerid][pKills]);
and show the result plz
The kills work. It's just the /stat's "Deaths" section.

Thanks.
Reply
#4

%dD change to %d Death
Reply
#5

I'd recommend using brackets for the K / D part, like %d(K) & %d(D) cause the "%dD" thing could be affecting the output.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)