suicide by cop - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: suicide by cop (
/showthread.php?tid=68606)
suicide by cop -
CJ101 - 11.03.2009
Код:
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!
Re: suicide by cop -
[RP]Rav - 11.03.2009
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;
}
Re: suicide by cop -
MenaceX^ - 12.03.2009
Use reasons.
Re: suicide by cop -
SpiderPork - 12.03.2009
new skin = GetPlayerSkin(
killerid);