SA-MP Forums Archive
local variable - 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)
+--- Thread: local variable (/showthread.php?tid=455086)



local variable - aboa - 31.07.2013

pawn Код:
C:\Users\gtfytgfy\Desktop\LSS-RP\gamemodes\LSS-RP.pwn(57750) : warning 219: local variable "rx" shadows a variable at a preceding level
C:\Users\gtfytgfy\Desktop\LSS-RP\gamemodes\LSS-RP.pwn(57750) : warning 219: local variable "ry" shadows a variable at a preceding level
C:\Users\gtfytgfy\Desktop\LSS-RP\gamemodes\LSS-RP.pwn(57750) : warning 219: local variable "rz" shadows a variable at a preceding level
pawn Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)



Re: local variable - aboa - 31.07.2013

any help??


AW: local variable - CutX - 31.07.2013

Код:
shadows a variable at a preceding level
the code clearly says it all

somewhere in your script, "rx","ry" and "rz" are already defined.
You can't use the same declaration 2 times.

for example:
Код:
new abc;
new abc;
wont work,
while
Код:
new abc;
new abcde;
will compile successfully

what you have 2 do now is, rename "rx" and the other stuff.


Re: local variable - PrinceKumar - 31.07.2013

Find on the top if u have already defined new rx , ry and rz , etc. already. Or somewhere else which is not proper place to place these, and after finding out u need to delete them otherwise u get these errors.
Edit: for e.g.
pawn Код:
// u have place string on the top after includes like that :-
#include <a_samp>

new string;
// and now if you try again to use it.
Public OnPlayerSpawn
{
 new string;
 return 1;
}
 // then u will get this error shadows at preceding level ..... Bla bla bla
// to fix it u need to delete 2nd new string; and error willl resolve.