Have Some question
#1

How can i make a random money when player enter checkpoint . i want it random from 5000$ - 7500$
Reply
#2

Код:
 new themoney = random(5000 - 7500) + 1000;
GivePlayerMoney(playerid, themoney);
Put this under OnPlayerEnterCheckpoint or OnPlayerEnterRaceCheckpoint
Reply
#3

Quote:
Originally Posted by ThatFag
Посмотреть сообщение
Код:
 new themoney = random(5000 - 7500) + 1000;
GivePlayerMoney(playerid, themoney);
Put this under OnPlayerEnterCheckpoint or OnPlayerEnterRaceCheckpoint
That would give the player an amount between 1000 and 3499..

money = random(2501) + 5000;

EDIT: If I noticed that '5000' and '7500' were around the wrong way, that is...
Reply
#4

what means + 1000
Reply
#5

Quote:
Originally Posted by ThatFag
Посмотреть сообщение
Код:
 new themoney = random(5000 - 7500) + 1000;
GivePlayerMoney(playerid, themoney);
Put this under OnPlayerEnterCheckpoint or OnPlayerEnterRaceCheckpoint
This will give extremely high number actually as the value in random function will be negative.

pawn Код:
RandomEx(min, max) return random(max - min) + min;
Since the value will be 0 to max-1, you need to add 1 to for the max parameter:
pawn Код:
GivePlayerMoney(playerid, RandomEx(5000, 7500 + 1));
Reply
#6

oh i will try all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)