11.05.2015, 18:32
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:
command(stats-... line:
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, 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; }