local variable "Random" shadows a variable at a preceding level
#1

I have this problem...

Код:
new Random = random(3);
		if(Random == 0)
		{
			SetPlayerAttachedObject(playerid, 1, 2844, 6, 0.728, -0.0619, -0.320, -106.100, -2.299, 151.300);
		}
		if(Random == 1)
		{
			SetPlayerAttachedObject(playerid, 1, 2819, 6, 0.777, 0.000, 0.00, -105.099, -0.799, 101.6999);
		}
		if(Random == 2)
		{
			SetPlayerAttachedObject(playerid, 1, 2843, 6, -0.516, 0.137, 0.186, -116.5, -4.899, -7.7999);
		}
		HoldingObject[playerid] = 2844;
		SendClientMessage(playerid, WHITE, "Operite prljavo rublje u masini za ves.");
	}
	else
	{
		SendClientMessage(playerid, WHITE, "Niste blizu prljavog rublja.");
	}
EVERYWHERE WHERE IS IN EXAMPLE: new Random = random(20);
Is warning..
Reply
#2

There's probably a global variable or a function called "Random". Just change the name of the variable.
Reply
#3

Код:
new Rd = random(3);
		if(Rd == 0)
		{
			SetPlayerAttachedObject(playerid, 1, 2844, 6, 0.728, -0.0619, -0.320, -106.100, -2.299, 151.300);
		}
		if(Rd == 1)
		{
			SetPlayerAttachedObject(playerid, 1, 2819, 6, 0.777, 0.000, 0.00, -105.099, -0.799, 101.6999);
		}
		if(Rd == 2)
		{
			SetPlayerAttachedObject(playerid, 1, 2843, 6, -0.516, 0.137, 0.186, -116.5, -4.899, -7.7999);
		}
		HoldingObject[playerid] = 2844;
		SendClientMessage(playerid, WHITE, "Operite prljavo rublje u masini za ves.");
	}
	else
	{
		SendClientMessage(playerid, WHITE, "Niste blizu prljavog rublja.");
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)