detect knife kill
#1

how to detect knife kill?

i want that when player knifes other player he gets 500$

does its possible?
Reply
#2

use 0.3b

GEtplayerAnimation index and key change callback.

or use OnPlayerDeathCallback with reasons..
Reply
#3

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
      if(GetPlayerWeapon(killerid) == 4)
      {
            GivePlayerMoney(killerid, 500);
      }
      return 1;
}
Reply
#4

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;
}
Reply
#5

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.
Reply
#6

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^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)