19.10.2014, 12:24
debug....
EDIT: post it in no time
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
PInfo[playerid][Deaths]++;
PInfo[killerid][Kills]++;
new weapname[50];
new string[128];
GetWeaponName(GetPlayerWeapon(killerid), weapname, sizeof(weapname));
printf("id %d has entered Onplayerdeath",playerid);//this prints to the console if player got killed
switch (reason)
{
case 49:
{
format(string, sizeof(string), "~r~%s~w~ got ~r~hit by a vehicle.", GetPName(playerid));
SendClientMessageToAll(COL_RED, string);
printf("%d death reason: vehicle",playerid);//this prints to the console if player get killed by vehicle
}
case 50:
{
format(string, sizeof(string), "~r~%s~w~ got ~r~Heli-bladed.", GetPName(playerid));
SendClientMessageToAll(COL_RED, string);
print("case 50");
}
case 51:
{
format(string, sizeof(string), "~r~%s~w~ has ~r~died in explosion.", GetPName(playerid));
SendClientMessageToAll(COL_RED, string);
print("case 51");
}
case 53:
{
format(string, sizeof(string), "~r~%s~w~ has ~r~drowned.", GetPName(playerid));
TextDrawSetString(Killpopup1, string);
print("case 53");
}
case 54:
{
format(string, sizeof(string), "~r~%s~w~ has ~r~fell to death.", GetPName(playerid));
SendClientMessageToAll(COL_RED, string);
}
default:
{
print("player died without reason");
format(string, sizeof(string), "~r~%s~w~ has died.", GetPName(playerid));
SendClientMessageToAll(COL_RED, string);
}
}
print("onplayerdeath done");
return 1;
}