Gate Issue With Compileing - 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: Gate Issue With Compileing (
/showthread.php?tid=161219)
Gate Issue With Compileing -
robert4049 - 19.07.2010
Okay I get these errors
Код:
C:\Users\Robert\Desktop\SA-MP\gamemodes\skrp.pwn(1483) : warning 217: loose indentation
C:\Users\Robert\Desktop\SA-MP\gamemodes\skrp.pwn(1550) : error 001: expected token: ")", but found "-identifier-"
C:\Users\Robert\Desktop\SA-MP\gamemodes\skrp.pwn(1551) : error 001: expected token: ")", but found "-identifier-"
C:\Users\Robert\Desktop\SA-MP\gamemodes\skrp.pwn(1554) : error 017: undefined symbol "playerid"
C:\Users\Robert\Desktop\SA-MP\gamemodes\skrp.pwn(1558) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Top
Код:
forward GateCheck();
new LSPDFRONT;
new LSPDGARAGE;
self explaintory
Код:
public OnGameModeInit()
{
LSPDFRONT = CreateObject(7657, 1542.5922851563, -1627.6103515625, 14.099655151367, 0, 0, 269.77499389648);
LSPDGARAGE = CreateObject(10184, 1591.197265625, -1630.9213867188, 14.914584159851, 0, 0, 0);
SetTimer("GateCheck",1000,1);
return 1;
}
and the main code
Код:
public GateCheck()
{
new LSPDFRONTOpen;
new LSPDGARAGEOpen;
for(new playerid; playerid<MAX_PLAYERS; playerid++)
{
if(IsPlayerInRangeOfPoint(playerid,10.0,1542.5922851563, -1627.6103515625, 14.099655151367)LSPDFRONTOpen=1;
if(IsPlayerInRangeOfPoint(playerid,10.0,1591.197265625, -1630.9213867188, 14.914584159851)LSPDGARAGEOpen=1;
}
//LSPD FRONT
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
if(LSPDFRONTOpen)MoveObject(LSPDFRONT,1542.5922851563, -1627.6103515625, 8.099655151367,8); //These are the coordinates of the gate if it were in it's opened state.
else MoveObject(LSPDFRONT,1542.5922851563, -1627.6103515625, 14.099655151367,8);//These are the coordinates of the gate if it were in it's closed state.
//LSPD GARAGE
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
if(LSPDGARAGEOpen)MoveObject(LSPDGARAGE,1591.197265625, -1630.9213867188, 8.914584159851,8); //These are the coordinates of the gate if it were in it's opened state.
else MoveObject(LSPDGARAGE, 1591.197265625, -1630.9213867188, 14.914584159851,8);//These are the coordinates of the gate if it were in it's closed state.
}
now the question is what did i screw up this time :P
Re: Gate Issue With Compileing -
Betamaster - 19.07.2010
And which line is 1550?
Re: Gate Issue With Compileing -
robert4049 - 19.07.2010
1550 is
Код:
if(IsPlayerInRangeOfPoint(playerid,10.0,1542.5922851563, -1627.6103515625, 14.099655151367)LSPDFRONTOpen=1;
Re: Gate Issue With Compileing -
Betamaster - 19.07.2010
Use some spaces and indents and the error would be simple to spot.
pawn Код:
if( IsPlayerInRangeOfPoint(playerid,10.0,1542.5922851563, -1627.6103515625, 14.099655151367) ) LSPDFRONTOpen = 1;
etc
Re: Gate Issue With Compileing -
bartje01 - 19.07.2010
forward GateCheck();
must be
forward GateCheck(playerid);
and
public GateCheck()
must be
public GateCheck(playerid)
I hope this will help