doing random number with number range defined
#1

So i have this code here

Код:
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;
}
and i wanna add a random value of cash to award here:

Код:
GivePlayerMoney(killerid,(RANDOM AMMOUNT BETWEEN X and X here );
any way to do that?
Reply


Messages In This Thread
doing random number with number range defined - by henry jiggy - 10.08.2011, 22:10
Re: doing random number with number range defined - by =WoR=Varth - 10.08.2011, 22:19
Re: doing random number with number range defined - by PrawkC - 10.08.2011, 22:57
Re: doing random number with number range defined - by PrawkC - 10.08.2011, 22:59

Forum Jump:


Users browsing this thread: 3 Guest(s)