SA-MP Forums Archive
Need help with random - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with random (/showthread.php?tid=144755)



Need help with random - Anthony_Brassi - 28.04.2010

blank


Re: Need help with random - Anthony_Brassi - 29.04.2010

Bump!


Re: Need help with random - Anthony_Brassi - 30.04.2010

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


Re: Need help with random - Anthony_Brassi - 01.05.2010

wow, 6th page already,


Re: Need help with random - MadeMan - 01.05.2010

What are you trying to do?


Re: Need help with random - Anthony_Brassi - 01.05.2010

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


Re: Need help with random - Assyria - 01.05.2010

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

-> 

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



Re: Need help with random - Anthony_Brassi - 01.05.2010

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


Re: Need help with random - Assyria - 01.05.2010

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


Re: Need help with random - Anthony_Brassi - 01.05.2010

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