Win money when you kill 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: Win money when you kill someone (
/showthread.php?tid=186295)
Win money when you kill someone -
Amator - 28.10.2010
Hey
I'd like to script but I need help. When a player kill another, killer win +$500. Can you help?
Thx
Re: Win money when you kill someone -
0ne - 28.10.2010
below OnPlayerDeath:
GivePlayerMoney(killerid,500);
Re: Win money when you kill someone -
Hiddos - 28.10.2010
Easy enough, rofl.
I can see you're new to scripting so I'll keep it simple:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) //This code gets called when somebody dies.
{
if(IsPlayerConnected(killerid)) //Checks if there really is a "killer" - more ways of death are for example falling from great heights, so there isn't a killer there!
{
GivePlayerMoney(killerid, 500); //Give the player 500 dollars
}
return 1;
}
Re : Win money when you kill someone -
Amator - 28.10.2010
Thank you for you nice help