[HELP] GivePlayerMoney on OnPlayerDeath
#1

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;
}
Reply
#2

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

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.
Reply
#4

your code gives the player who killed 2500 $
Reply
#5

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

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
Reply
#7

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

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

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)