18.08.2014, 11:05
You should check if 'killerid' is not INVALID_PLAYER_ID, otherwise your server will crash...
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid == INVALID_PLAYER_ID) return 1;
new string[12];
if(pInfo[killerid][Team] == 1)
{
MapKillsSoldiers++;
format(string, sizeof (string), "%i", MapKillsSoldiers);
TextDrawSetString(Textdraw12, string); // Change "Textdraw12" to your MapKillsSoldiers textdraw ID.
}
if(pInfo[killerid][Team] == 2)
{
MapKillsTerrorists++;
format(string, sizeof (string), "%i", MapKillsTerrorists);
TextDrawSetString(Textdraw13, string); // Change "Textdraw13" to your MapKillsTerrorists textdraw ID.
}
return 1;
}