SA-MP Forums Archive
Random question - 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: Random question (/showthread.php?tid=67829)



Random question - Leoxide - 04.03.2009

Hi all, i'm going to do a menu. In this menu there are 3 item.

Item1
Item2
Item3

When i select first item, i would like to do 1 of these things:

Give +200$
Give -300$
Spawn a car near player and give +100$

Код:
	if(menuid == menu6)
	{
	  switch(row)
	  {
	    case 0..2:
	    {
	      RandomChoice(playerid);
			}
		}
	}
Код:
forward RandomChoice(playerid);
public RandomChoice(playerid)
{
    // Here the random 
	TogglePlayerControllable(playerid,true);
	HideMenuForPlayer(GetPlayerMenu(playerid),playerid);
}
I've tried to do this script with myself but it doesn't work :S

Can anyone please help me? Thx

So, sorry for my bad english :S


Re: Random question - Rks25 - 04.03.2009

Learn how to attach variables with random(); and htan how to use it with if(variable == 1...) do that else.