SA-MP Forums Archive
[HELP] GivePlayerMoney on OnPlayerDeath - 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)
+--- Thread: [HELP] GivePlayerMoney on OnPlayerDeath (/showthread.php?tid=287781)



[HELP] GivePlayerMoney on OnPlayerDeath - Swizzzy - 04.10.2011

Well, I wanted to find out and examine a code which would Give Players money when they kill another player, E.G.

This is a just a some sort of example/explanation of what is needed, Posting a code would be hugely appreciated.

Would this code work?


pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    GivePlayerMoney(killerid, 2500);
    return 1;
}



Re : [HELP] GivePlayerMoney on OnPlayerDeath - Naruto_Emilio - 04.10.2011

What do you mean what do you want exacly?? a message sent to the player that you got money or what?


Re: Re : [HELP] GivePlayerMoney on OnPlayerDeath - Swizzzy - 04.10.2011

Quote:
Originally Posted by Naruto_Emilio
Посмотреть сообщение
What do you mean what do you want exacly?? a message sent to the player that you got money or what?
No, Money would be sent to a player after they kill another player.


Re: [HELP] GivePlayerMoney on OnPlayerDeath - Tigerkiller - 04.10.2011

your code gives the player who killed 2500 $


Re : [HELP] GivePlayerMoney on OnPlayerDeath - Naruto_Emilio - 04.10.2011

You meant this?:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new money = GetPlayerMoney(playerid);
    GivePlayerMoney(killerid, money);
    ResetPlayerMoney(playerid);
    return 1;
}



Re: Re : [HELP] GivePlayerMoney on OnPlayerDeath - Tigerkiller - 04.10.2011

Quote:
Originally Posted by Naruto_Emilio
Посмотреть сообщение
You meant this?:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
 new money = GetPlayerMoney(playerid);
    GivePlayerMoney(killerid, money);
    ResetPlayerMoney(playerid);
    return 1;
}
no he only want to give money


Re: [HELP] GivePlayerMoney on OnPlayerDeath - Swizzzy - 04.10.2011

So my code gives $2500 to the PLAYER Who killed the other PLAYER?


Re : [HELP] GivePlayerMoney on OnPlayerDeath - Naruto_Emilio - 04.10.2011

Your script does, my script does this: He will reset the died player to 0 and his money will go to the killer


Re: [HELP] GivePlayerMoney on OnPlayerDeath - knackworst - 04.10.2011

Yes it does...
If u want the playerid to lose the amount just make the amount negative and change killerid into playerid


Re : [HELP] GivePlayerMoney on OnPlayerDeath - Naruto_Emilio - 04.10.2011

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    GivePlayerMoney(killerid, 2500);
    SendClientMessage(killerid, COLOR_GREEN, "You got 2500$ for killing this noob");
    GivePlayerMoney(playerid, -2500);
    SendClientMessage(playerid, COLOR_RED, "You lost -2500$, You got owned noob");
    return 1;
}