SA-MP Forums Archive
Money From Killing Someone - 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: Money From Killing Someone (/showthread.php?tid=154840)



Money From Killing Someone - Jonny_lockhart - 15.06.2010

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


Re: Money From Killing Someone - Naxix - 15.06.2010

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



Re: Money From Killing Someone - DJDhan - 15.06.2010

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



Re: Money From Killing Someone - Naxix - 15.06.2010

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


Re: Money From Killing Someone - DJDhan - 15.06.2010

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


Re: Money From Killing Someone - Naxix - 15.06.2010

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?