PDA

View Full Version : I need help


helloah892
16/07/2019, 12:34 PM
I need someone to tell me how to fix these errors
1.warning 219: local variable "Random" shadows a variable at a preceding level
new str[53], Random = random(sizeof(Shop_Robbery_Cash)), cash, Chance = random(3);
2.warning 219: local variable "Random" shadows a variable at a preceding level
new Random = random(sizeof(RandomSpawn));
3.warning 219: local variable "Random" shadows a variable at a preceding level
Random = random(2),
4.warning 219: local variable "Random" shadows a variable at a preceding level
new Random = random(sizeof(PrisonSpawn));
5.warning 219: local variable "Random" shadows a variable at a preceding level
new Random = random(sizeof(TransportationCash)),Cash,str[77];

Mugala
16/07/2019, 12:35 PM
you have used new Random for 2 or more times, remove unnecessary Random variables, try to use this in certain codes.

helloah892
16/07/2019, 12:38 PM
Can you explain this

Mugala
16/07/2019, 12:41 PM
If you have a global variable (out of any code, at the top of script or etc..) named new Random, just remove or rename it.

helloah892
16/07/2019, 12:44 PM
I can't understand till now

Mugala
16/07/2019, 12:49 PM
just use new RandomNumber instead of new Random.

https://i.imgur.com/OOpPeQG.png

GTLS
17/07/2019, 07:56 AM
You cant have same varible names in same scope. So, if you have a global variable named "Random" in your script, you can not use that name in any function. Change the name to something else.. and error will be solved

helloah892
17/07/2019, 08:03 AM
Thanks it helped me