SA-MP Forums Archive
help me please - 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: help me please (/showthread.php?tid=433493)



help me please - Jack_Ryder - 27.04.2013

This bug is showen to me can any one help me
pawn Код:
C:\Users\Mohamad\Desktop\San Andreas Roleplay\gamemodes\gtarlrp.pwn(37994) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\Users\Mohamad\Desktop\San Andreas Roleplay\gamemodes\gtarlrp.pwn(38814) : warning 219: local variable "idx" shadows a variable at a preceding level
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
in line 37994 and line below wrote:
pawn Код:
for(new idx = 0; idx< sizeof(DoorInfo); idx++) // Dynamic Doors < sizeof(
        {
            if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]))
            {
                if(DoorInfo[idx][dCInt])
                {
                    Pause(playerid);
                }
                SetPlayerInterior(playerid, DoorInfo[idx][dIInt]);
                SetPlayerVirtualWorld(playerid, DoorInfo[idx][dIVW]);
                SetPlayerFacingAngle(playerid, DoorInfo[idx][dIA]);
                SetCameraBehindPlayer(playerid);
                SetPlayerPos(playerid, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]);
                return 1;
            }
        }
in line 38814 and line below wrote:
pawn Код:
for(new idx=0; idx<MAX_DOORS; idx++) // Dynamic Doors
        {
            if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]) && GetPlayerVirtualWorld(playerid) == DoorInfo[idx][dIVW] && GetPlayerInterior(playerid) == DoorInfo[idx][dIInt])
            {
                if(DoorInfo[idx][dCExt])
                {
                    Pause(playerid);
                }
                SetPlayerInterior(playerid, DoorInfo[idx][dOInt]);
                SetPlayerVirtualWorld(playerid, DoorInfo[idx][dOVW]);
                SetPlayerFacingAngle(playerid, DoorInfo[idx][dOA]);
                SetCameraBehindPlayer(playerid);
                SetPlayerPos(playerid, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]);
            }
        }



Re: help me please - Jack_Ryder - 27.04.2013

any help??


Re: help me please - Stanford - 27.04.2013

I'm so interested to see the solution of this, any help?


Re: help me please - PT - 27.04.2013

Hello

Try this, i'm not a very good scripter, but try...

pawn Код:
for(new ptidx = 0; ptidx< sizeof(DoorInfo); ptidx++) // Dynamic Doors < sizeof(
{
    if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[ptidx][dOX], DoorInfo[ptidx][dOY], DoorInfo[ptidx][dOZ]))
    {
        if(DoorInfo[ptidx][dCInt])
        {
            Pause(playerid);
        }
        else
        {
            SetPlayerInterior(playerid, DoorInfo[ptidx][dIInt]);
            SetPlayerVirtualWorld(playerid, DoorInfo[ptidx][dIVW]);
            SetPlayerFacingAngle(playerid, DoorInfo[ptidx][dIA]);
            SetCameraBehindPlayer(playerid);
            SetPlayerPos(playerid, DoorInfo[ptidx][dIX], DoorInfo[ptidx][dIY], DoorInfo[ptidx][dIZ]);
        }
        return 1;
    }
}

for(new ptiidx=0; ptiidx<MAX_DOORS; ptiidx++) // Dynamic Doors
{  
    if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[ptiidx][dIX], DoorInfo[ptiidx][dIY], DoorInfo[ptiidx][dIZ]) && GetPlayerVirtualWorld(playerid) == DoorInfo[ptiidx][dIVW] && GetPlayerInterior(playerid) == DoorInfo[ptiidx][dIInt])
    {
        if(DoorInfo[ptiidx][dCExt])
        {
            Pause(playerid);
        }
        else
        {
            SetPlayerInterior(playerid, DoorInfo[ptiidx][dOInt]);
            SetPlayerVirtualWorld(playerid, DoorInfo[ptiidx][dOVW]);
            SetPlayerFacingAngle(playerid, DoorInfo[ptiidx][dOA]);
            SetCameraBehindPlayer(playerid);
            SetPlayerPos(playerid, DoorInfo[ptiidx][dOX], DoorInfo[ptiidx][dOY], DoorInfo[ptiidx][dOZ]);
        }
        return 1;
    }
}
I hope help you

PT


Re: help me please - Jack_Ryder - 27.04.2013

thx bro for help


Re: help me please - PT - 27.04.2013

You Welcome!

PT