Receive Cash
#1

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

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    GivePlayerMoney(killerid, 10000); // Gives the killer 10000 dollars. Change 10000 to your likenings ;)
    return 1;
}
Reply
#3

What the above poster said. How ever you may want to full proof it by checking if the killerid is valid XD
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)