Posts: 1,530
Threads: 16
Joined: Feb 2011
Reputation:
0
new success = random(4);
if(success != 1)
return SendClientMessage(playerid, -1, "fail);
i'm not sure if the random get the 0 but i gess not... so this way if the random returns 1 he will be able to rob else he will receive the message...
Posts: 32
Threads: 11
Joined: Mar 2009
Reputation:
0
How can I use the random(4) in my favor? For example random(2) = 50% chance.
And I didn't quite get the "If(success != 1)". Why should it be different from 1?
Please explain, I would appreciate.
Thanks ^^
Posts: 1,530
Threads: 16
Joined: Feb 2011
Reputation:
0
The random get a random number between 1 (i'm not sure if is 1 or 0...probably 1) and the number that you put... so when you use random(4) the chances to return 1 is 25% that way you know that he failed if the number is different from 1 (the 1 can be any number between 1 and 4)
idk if you understood...sorry my bad english :/