27.03.2014, 23:43
pawn Код:
randmoney = random(50000 - 1000) + 1000;
randmoney = random(50000 - 1000) + 1000;
if(pickupid == your_pickup) { new str[44]; new randmoney = random(100001) - 50000; format(str, sizeof(str), " >> Player picked up %s and recieved $%d", your_pickup, randmoney); SendClientMessage(playerid, 0xffffffff, str); GivePlayerMoney(playerid, randmoney); }
GivePlayerMoney(playerid,random(100000-50000)+50000);
randmoney = random(50000 - 1000) + 1000;
// randmoney is a variable. It can store a value.
//random is a function that generate a random number between 0 and it params, for example:
//random(1000) will return a number between 0 and 999.
//+ 1000 always will add 1000 to the random value;
//For example, random return 515. 515 + 1000 = 515, so randmoney = 515.
pawn Код:
|
40000 + random(60000)
randmoney = random(50000 - 1000) + 1000;
randmoney = random(40000 + 60000) + 1000;
stock RandomEx(min, max)
{
return random(max - min) + min;
}
randmoney = RandomEx(40000, 100000);