Need help with random
#1

blank
Reply
#2

Bump!
Reply
#3

i really hate bumping my own topic, 4th page.
Reply
#4

wow, 6th page already,
Reply
#5

What are you trying to do?
Reply
#6

Quote:
Originally Posted by MadeMan
What are you trying to do?
trying to set it so when u /wdefuse it does random DefuseCodeWall, 1,2,3
Reply
#7

Код:
 DefuseCodeWall = RandomCode[randCode][0], RandomCode[randCode][1],RandomCode[randCode][2];

-> 

 DefuseCodeWall = RandomCode[randCode][0], RandomCode[randCode][1],RandomCode[randCode][2],RandomCode[randCode][3]; // works
Reply
#8

Quote:
Originally Posted by Assyria
Код:
 DefuseCodeWall = RandomCode[randCode][0], RandomCode[randCode][1],RandomCode[randCode][2];

-> 

 DefuseCodeWall = RandomCode[randCode][0], RandomCode[randCode][1],RandomCode[randCode][2],RandomCode[randCode][3]; // works
C:\Users\John\Desktop\CSS\gamemodes\cs.pwn(1367) : warning 215: expression has no effect
C:\Users\John\Desktop\CSS\gamemodes\cs.pwn(1367) : warning 215: expression has no effect
C:\Users\John\Desktop\CSS\gamemodes\cs.pwn(1367) : warning 215: expression has no effect
Reply
#9

Try this: I assume this simpler for this case..?
Код:
forward randcode(playerid);
public randcode(playerid)
{
	new rand = random(3);
 	if (rand == 0)
 	{
     // Random thing number 1 
    }
	if (rand == 1)
 	{
     // Random thing number 2 
	}
	if (rand == 2)
 	{
     // Random thing number 3
    }
    return 1;
}
And you can delete the new RandomCode thing
Reply
#10

Quote:
Originally Posted by Assyria
Try this: I assume this simpler for this case..?
Код:
forward randcode(playerid);
public randcode(playerid)
{
	new rand = random(3);
 	if (rand == 0)
 	{
     // Random thing number 1 
    }
	if (rand == 1)
 	{
     // Random thing number 2 
	}
	if (rand == 2)
 	{
     // Random thing number 3
    }
    return 1;
}
And you can delete the new RandomCode thing
ty ill try it l8er
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)