08.11.2016, 03:50
like the title i want onplayerentercheckpoint it's will random a money is 5000 and 6500
and random some sendclientmessege
and random some sendclientmessege
randomEx(minnum = cellmin, maxnum = cellmax) return random(maxnum - minnum + 1) + minnum; // Credits to Y_Less (Add this anywhere in your script)
public OnPlayerEnterCheckpoint(playerid)
{
new rand, string[128];
rand = randomEx(5000, 6500); //Creates a random number between 5000, and 6500
GivePlayerMoney(playerid, rand); //Gives the player the random number generated
format(string,sizeof(string), "You have been given $%d.", rand); //Formats the message that will be displayed to the player
SendClientMessage(playerid, COLOR_WHITE, string); //Prints the message
return 1;
}
}
stock DualValueRandomEx(min, max)
{
new rand = random(max-min)+min;
return rand;
}