Command Chance? Making commands randomly work
#1

Can someone explain to me how to give the command a chance like If i type /rob . one moment it will say
'Success you robbed [Cali]ChrOnic_T' and the next moment it says 'Failed to rob [Cali]ChrOnic_T'.

Explain please.
Reply
#2

for example:

pawn Код:
if(!random(5)) return SendClientMessage(playerid,-1,"'Success you robbed [Cali]ChrOnic_T");//random(5) means 0 1 2 3 4 so there is 20% chance
else SendClientMessage(playerid,-1,"'Failed to rob [Cali]ChrOnic_T");
Reply
#3

put
pawn Код:
new rndm = random(2);

switch(rndm)
{
    case 0: //Success you robbed [Cali]ChrOnic_T
    case 1: //Failed to rob [Cali]ChrOnic_T
}
inside the command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)