detect knife kill - 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: detect knife kill (
/showthread.php?tid=172558)
detect knife kill -
jaksimaksi - 30.08.2010
how to detect knife kill?
i want that when player knifes other player he gets 500$
does its possible?
Re: detect knife kill -
GaGlets(R) - 30.08.2010
use 0.3b
GEtplayerAnimation index and key change callback.
or use OnPlayerDeathCallback with reasons..
Re: detect knife kill -
Bumbis - 30.08.2010
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerWeapon(killerid) == 4)
{
GivePlayerMoney(killerid, 500);
}
return 1;
}
Re: detect knife kill -
CAR - 30.08.2010
Quote:
Originally Posted by silvis123
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) { if(GetPlayerWeapon(killerid) == 4) { GivePlayerMoney(killerid, 500); } return 1; }
|
Yes, but then he can also kill with a Gun while he's got a knife, use this:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(reason == 4)
{
GivePlayerMoney(killerid, 500);
}
return 1;
}
Re: detect knife kill -
nemesis- - 30.08.2010
Quote:
Originally Posted by CAR
Yes, but then he can also kill with a Gun while he's got a knife, use this:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) { if(reason == 4) { GivePlayerMoney(killerid, 500); } return 1; }
|
GetPlayerWeapon() returns the weapon that the player is currently holding.
Re: detect knife kill -
Voldemort - 30.08.2010
Quote:
Originally Posted by nemesis-
GetPlayerWeapon() returns the weapon that the player is currently holding.
|
In this case reason == 4, is best way, because it fractiion of a second you can change your weapon^^