SA-MP Forums Archive
2 Warnings - 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: 2 Warnings (/showthread.php?tid=287085)



2 Warnings - Ehab1911 - 01.10.2011

Код:
C:\Users\GuitarsRockMe\Downloads\Compressed\serverh3h3\test.pwn(12095) : warning 219: local variable "ud" shadows a variable at a preceding level
C:\Users\GuitarsRockMe\Downloads\Compressed\serverh3h3\test.pwn(12095) : warning 219: local variable "lr" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
How can I fix that guys?

Here are the lines:

pawn Код:
if(mapstarted[playerid] == 1)
    {
        new o,ud,lr;
        GetPlayerKeys(playerid,o,ud,lr);
        if(ud > 0)
        {
            mapY[playerid] = mapY[playerid] - 10.0000;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 15.3746);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], mapZ[playerid] + 10.0000);
        }
        else if(ud < 0)
        {
            mapY[playerid] = mapY[playerid] + 10.0000;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 15.3746);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], mapZ[playerid] + 10.0000);
            return 1;
        }
        if(lr > 0)
        {
            mapX[playerid] = mapX[playerid] + 10.0000;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 15.3746);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], mapZ[playerid] + 10.0000);
        }
        else if(lr < 0)
        {
            mapX[playerid] = mapX[playerid] - 10.0000;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 15.3746);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], mapZ[playerid] + 10.0000);
            return 1;
        }
    }



Re: 2 Warnings - Jafet_Macario - 01.10.2011

pawn Код:
new o,ud,lr;
To:
pawn Код:
new o;


This forum requires that you wait 120 seconds between posts. Please try again in 48 seconds annoying....


Re: 2 Warnings - Kingunit - 01.10.2011

pawn Код:
if(mapstarted[playerid] == 1)
    {
        new o;
        GetPlayerKeys(playerid,o,ud,lr);
        if(ud > 0)
        {
            mapY[playerid] = mapY[playerid] - 10.0000;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 15.3746);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], mapZ[playerid] + 10.0000);
        }
        else if(ud < 0)
        {
            mapY[playerid] = mapY[playerid] + 10.0000;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 15.3746);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], mapZ[playerid] + 10.0000);
            return 1;
        }
        if(lr > 0)
        {
            mapX[playerid] = mapX[playerid] + 10.0000;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 15.3746);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], mapZ[playerid] + 10.0000);
        }
        else if(lr < 0)
        {
            mapX[playerid] = mapX[playerid] - 10.0000;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 15.3746);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], mapZ[playerid] + 10.0000);
            return 1;
        }
    }
It means that it's already written somewhere in your code.


Re: 2 Warnings - Ehab1911 - 01.10.2011

Oh, thank you guys .


Re: 2 Warnings - Kingunit - 01.10.2011

Quote:
Originally Posted by Ehab1911
Посмотреть сообщение
Oh, thank you guys .
No problem Cooley.