SA-MP Forums Archive
Help I get THis error - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help I get THis error (/showthread.php?tid=259318)



PLEAS HELP PLEAS I HAVE TROUBLE WITH AUTOGATES - -matt- - 04.06.2011

Hi i made this commands and when complie it says error on line this

Код:
C:\Users\Family\Desktop\UrbanRolePlay 0.3c\gamemodes\larp.pwn(79225) : error 017: undefined symbol "playerid"
C:\Users\Family\Desktop\UrbanRolePlay 0.3c\gamemodes\larp.pwn(79247) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: Help I get THis error - Tee - 04.06.2011

You need to post the code and the lines that the errors are in.


Re: Help I get THis error - Scenario - 04.06.2011

You are using "playerid", but you didn't define what "playerid" is in the part of code you are trying to compile. Show lines 79225 and 79247.


Re: Help I get THis error - -matt- - 04.06.2011

red lines are where error pops up
and im using ravens roleplay to test this.

Quote:

public FBIRightGatesOpen()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(FBIRightGateOpen == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 6)
{
MoveObject(FBIRightGate, -1781.65063477,971.39666748,31.50776672, 5);
FBIRightGateOpen =1;
SetTimer("FBIRightGatesClose",7000,0);
}
}
}
}

public FBILeftGatesOpen()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(FBILeftGateOpen == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 6)
{
MoveObject(FBILeftGate, -1781.49548340,996.09625244,31.50776672, 5);
FBILeftGateOpen =1;
SetTimer("FBILeftGatesClose",7000,0);
}
}
}
}

Thats are the lines with error


Re: Help I get THis error - kin - 04.06.2011

use i instead.


Re: Help I get THis error - [L3th4l] - 04.06.2011

pawn Код:
public FBIRightGatesOpen()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
       if(FBIRightGateOpen == 0)
       {
           if(PlayerInfo[i][pAdmin] >= 6)
           {
               MoveObject(FBIRightGate, -1781.65063477,971.39666748,31.50776672, 5);
               FBIRightGateOpen =1;
               SetTimer("FBIRightGatesClose",7000,0);
           }
       }
    }
}

public FBILeftGatesOpen()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(FBILeftGateOpen == 0)
{
if(PlayerInfo[i][pAdmin] >= 6)
{
MoveObject(FBILeftGate, -1781.49548340,996.09625244,31.50776672, 5);
FBILeftGateOpen =1;
SetTimer("FBILeftGatesClose",7000,0);
}
}
}
}



Re: Help I get THis error - -matt- - 04.06.2011

Quote:

use i instead.

where i put i >>?


Re: Help I get THis error - Tee - 04.06.2011

You needed to use "i" as Kin said. Also I can bet you count the opening brackets and then put the same number of closing brackets, indentation matters. Anyway here it is:

pawn Код:
public FBIRightGatesOpen()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(FBIRightGateOpen == 0)
        {
            if(PlayerInfo[i][pAdmin] >= 6)
            {
                MoveObject(FBIRightGate, -1781.65063477,971.39666748,31.50776672, 5);
                FBIRightGateOpen =1;
                SetTimer("FBIRightGatesClose",7000,0);
            }
        }
    }
}

public FBILeftGatesOpen()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(FBILeftGateOpen == 0)
        {
            if(PlayerInfo[i][pAdmin] >= 6)
            {
                MoveObject(FBILeftGate, -1781.49548340,996.09625244,31.50776672, 5);
                FBILeftGateOpen =1;
                SetTimer("FBILeftGatesClose",7000,0);
            }
        }
    }
}
EDIT: [L3th4l] beat me :P


Re: Help I get THis error - -matt- - 04.06.2011

thanks [L3th4l] The complie work il just go make shure gate works


Re: Help I get THis error - -matt- - 04.06.2011

got second question the hole thing works but the gates stays open why