10.08.2011, 22:10
So i have this code here
and i wanna add a random value of cash to award here:
any way to do that?
Код:
public OnPlayerDeath(playerid, killerid, reason) { SendDeathMessage(killerid, playerid, reason); // check if the player is connected if(IsPlayerConnected(killerid)) { // if the killer's team = killed player's team, then... if(gTeam[playerid]==gTeam[killerid]) { // reduce his score by 2 SetPlayerScore(killerid,GetPlayerScore(killerid)-2); // send him a red message saying that he lost 2 points SendClientMessage(killerid,0xFF3030AA,"DONT TEAMKILL!!You lost 2 points as punishment."); } // if player's ID isn't = killer's ID the killer had to kill an enemy, so let's add him a point,and give him MONIES :D $$$ else { SetPlayerScore(killerid,GetPlayerScore(killerid)+1); GivePlayerMoney(killerid, ); } } return 1; }
Код:
GivePlayerMoney(killerid,(RANDOM AMMOUNT BETWEEN X and X here );