Need help with random
#1

Hi, this script is supposed to make player struggle when shot in any leg, but the chance is 1 in 2 as I understand, but I get these errors:
Код:
(21) : error 017: undefined symbol "Random"
(41) : error 017: undefined symbol "Random"
Code:
Код:
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        SetPlayerHealth(playerid, 0.0);
    }
	if(bodypart == 7)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
		}
		else
		{
			new Struggle = Random(1);
			switch(Struggle)
			{
			case 1:
			{
				ApplyAnimation(playerid, "ped", "FALL_collapse", 4.1, 0, 1, 1, 0, 0, 1);
			}
			case 2:
			{
			}
			}
		}
    }
	if(bodypart == 8)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
		}
		else
		{
			new Struggle = Random(1);
			switch(Struggle)
			{
			case 1:
			{
				ApplyAnimation(playerid, "ped", "FALL_collapse", 4.1, 0, 1, 1, 0, 0, 1);
			}
			case 2:
			{
			}
			}
		}
    }
How to fix it? Or there's a better way to make it random?
I tried putting new Struggle = Random(1); at the top of the script, but when I compile it successfully compiles, but pawno crashes.
Reply


Messages In This Thread
Need help with random - by GoldenLion - 09.05.2016, 17:46
Re: Need help with random - by Konstantinos - 09.05.2016, 17:53
Re: Need help with random - by F1N4L - 09.05.2016, 18:03
Re: Need help with random - by vannesenn - 09.05.2016, 18:09
Re: Need help with random - by GoldenLion - 09.05.2016, 18:35

Forum Jump:


Users browsing this thread: 1 Guest(s)