public OnPlayerDeath(playerid, killerid, reason) { PlayerInfo[playerid][pDeaths] += 1; if(killerid != INVALID_PLAYER_ID) { new str[256]; new name1[256]; new name2[256]; GetPlayerName(playerid, name1, sizeof(name1)); GetPlayerName(killerid, name2, sizeof(name2)); format(str, sizeof(str), "» You hunted %s(%i) down, gained: $10000 | Killer: %s(%i)", name1, playerid, name2, killerid); GivePlayerMoney(killerid, 10000); PlayerInfo[killerid][pKills] += 1; SendDeathMessage(killerid, playerid, reason); SendClientMessage(killerid, COLOR_LIGHTBLUE, "[=================| BOOM |=================]"); SendClientMessage(killerid, COLOR_GRAD1, str); SendClientMessage(killerid, COLOR_LIGHTBLUE, "[=================| BOOM |=================]"); return 1; } else { SendClientMessage(killerid, COLOR_LIGHTBLUE, "[=================| BOOM |=================]"); SendClientMessage(killerid, COLOR_GRAD1, "You have commited suicide."); SendClientMessage(killerid, COLOR_LIGHTBLUE, "[=================| BOOM |=================]"); return 1; } } |
GetPlayerName(playerid, name1, sizeof(name1));
GetPlayerName(playerid, name1, sizeof name1);
First try instead of:
pawn Код:
pawn Код:
|
First try instead of:
pawn Код:
pawn Код:
Second, check your strings for maybe conflicting characters (" ; ' [] = etc.) which wont make it appear. Else i dont know |
Will not work, those two things does the same. just to mention
OT: Ofc it will not work. you cant say else to if(killerid != INVALID_PLAYER_ID) if killerid and playerid is equal, then its suicide ... and insted of PlayerInfo[killerid][pDeaths] += 1; try PlayerInfo[killerid][pDeaths]++; |
But i don't get the suicide part.. Can you post a little script example
dont understand exactly |
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[playerid][pDeaths] += 1;
if(killerid == INVALID_PLAYER_ID) //If their is no killer
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[=================| BOOM |=================]");
SendClientMessage(playerid, COLOR_GRAD1, "You have commited suicide.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[=================| BOOM |=================]");
}
else if(killerid != INVALID_PLAYER_ID) //else if their is a killer
{
new str[200];
new name1[MAX_PLAYER_NAME];
new name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, name1, sizeof(name1));
GetPlayerName(killerid, name2, sizeof(name2));
format(str, sizeof(str), "» You hunted %s(%i) down, gained: $10000 | Killer: %s(%i)", name1, playerid, name2, killerid);
GivePlayerMoney(killerid, 10000);
PlayerInfo[killerid][pKills] += 1;
SendDeathMessage(killerid, playerid, reason);
SendClientMessage(killerid, COLOR_LIGHTBLUE, "[=================| BOOM |=================]");
SendClientMessage(killerid, COLOR_GRAD1, str);
SendClientMessage(killerid, COLOR_LIGHTBLUE, "[=================| BOOM |=================]");
}
return 1;
}