suicide by cop
#1

Код:
new skin;
skin = GetPlayerSkin(playerid);
if (skin == 287 || skin == 163 || skin == 282 || skin== 255 || skin== 165) //cop and army skins
{
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(killerid,name,MAX_PLAYER_NAME);
format(string, sizeof(string), "[POLICE]: %s is now wanted for killing a police officer.",name);
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
GivePlayerMoney(killerid,500);
}
ok, when someone dies from falling, or using a /kill cmd, the message still pops up. Any way to prevent? Plus, it even pops up when the person who died is not a cop!
Reply
#2

Well, not sure what causes the message for non cops, double check the skin IDs maybe? About your other problem

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  new skin = GetPlayerSkin(playerid);
  if (reason <= 42)
    if (skin == 287 || skin == 163 || skin == 282 || skin == 255 || skin == 165) //cop and army skins
    {
      new string[128];
      new name[MAX_PLAYER_NAME];
      GetPlayerName(killerid,name,MAX_PLAYER_NAME);
      format(string, sizeof(string), "[POLICE]: %s is now wanted for killing a police officer.",name);
      SendClientMessageToAll(COLOR_LIGHTBLUE,string);
      GivePlayerMoney(killerid,500);
    }

  return 1;
}
Reply
#3

Use reasons.
Reply
#4

new skin = GetPlayerSkin(killerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)