Money From Killing Someone
#1

How do I make it so that if you kill someone you gain 1000 dollars?
Reply
#2

OnPlayerDeath:
Код:
GivePlayerMoney(killerid,1000);
Reply
#3

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  if(killerid != INVALID_PLAYER_ID)
  {
  GivePlayerMoney(killerid,1000);
  }
  return 1;
}
Reply
#4

You don't really need "killerid != INVALID_ID" do you? As you die from suicide there simply aren't a killerid??
Reply
#5

If you die from suicide, the killerid is INVALID_PLAYER_ID. It's not just nothing when you die from suicide.
Reply
#6

Quote:
Originally Posted by DJDhan
If you die from suicide, the killerid is INVALID_PLAYER_ID. It's not just nothing when you die from suicide.
I know, but if it's a invalid playerid no1 gets money from killing you, so there aren't much point in the if statement?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)