Receive Cash - 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: Receive Cash (
/showthread.php?tid=168030)
Receive Cash -
Anotniomontana - 14.08.2010
Hi,
as i continue scripting my very own script (which i will probably post somewhere here)
I Would like to add to the script an effect that does that:
You kill another player >> you receive an amount of money
thanks in advance.
Re: Receive Cash -
rbN. - 14.08.2010
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
GivePlayerMoney(killerid, 10000); // Gives the killer 10000 dollars. Change 10000 to your likenings ;)
return 1;
}
Re: Receive Cash -
vital2k - 14.08.2010
What the above poster said. How ever you may want to full proof it by checking if the killerid is valid XD
Re: Receive Cash -
Anotniomontana - 14.08.2010
Lol, i found out before i got the comment, here's what i made:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
GivePlayerMoney(killerid,500);
SendClientMessage(killerid, 0x44BB44BB, "You recived 500 dollars for killing another player!");
GivePlayerMoney(playerid,-500);
SendClientMessage(playerid, 0x44BB44BB, "You have lost 500 dollars for dying!");
return 1;
}
Re: Receive Cash -
Claude - 14.08.2010
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
GivePlayerMoney(killerid, 10000);
}
return 1;
}