getting errors with this automatic gate script -
Mattjones17 - 03.01.2010
Hi,
I am trying to compile this as part of my GM:
public BusEnter()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerToPoint(10.0, i, -1754.092163, 757.279907, 23.990942) && OpenGate[i] == 0)
{
MoveObject(Busenter, -1754.091675, 757.228943, 22.89439

;
OpenGate[i] = 1;
}
else if(!PlayerToPoint(10.0, i, -1754.092163, 757.279907, 23.990942) && OpenGate[i] == 1)
{
MoveObject(Busenter, -1754.092163, 757.279907, 23.990942);
OpenGate[i] = 0;
}
}
return 1;
}
I get these errors:
C:\Users\Family\Documents\SFRP\SAMP 0.3\gamemodes\SC_pickup.pwn(10264) : warning 235: public function lacks forward declaration (symbol "BusEnter")
C:\Users\Family\Documents\SFRP\SAMP 0.3\gamemodes\SC_pickup.pwn(10269) : warning 213: tag mismatch
C:\Users\Family\Documents\SFRP\SAMP 0.3\gamemodes\SC_pickup.pwn(10271) : warning 202: number of arguments does not match definition
C:\Users\Family\Documents\SFRP\SAMP 0.3\gamemodes\SC_pickup.pwn(10274) : warning 213: tag mismatch
C:\Users\Family\Documents\SFRP\SAMP 0.3\gamemodes\SC_pickup.pwn(10276) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Any help is greatly appreciated
Thanks
Re: getting errors with this automatic gate script -
Deat_Itself - 03.01.2010
add
pawn Код:
forward BusEnter();//Global Variable
+
moveobject u put is wrong
Код:
MoveObject(objectid, x, y, z , speed);
Re: getting errors with this automatic gate script -
Mattjones17 - 03.01.2010
Hi,
I did that - but I still get
C:\Users\Family\Documents\SFRP\SAMP 0.3\gamemodes\SC_pickup.pwn(10270) : warning 213: tag mismatch
C:\Users\Family\Documents\SFRP\SAMP 0.3\gamemodes\SC_pickup.pwn(10275) : warning 213: tag mismatch
and the script doesnt start
Re: getting errors with this automatic gate script -
Deat_Itself - 03.01.2010
Quote:
Originally Posted by Mattjones17
Hi,
I did that - but I still get
C:\Users\Family\Documents\SFRP\SAMP 0.3\gamemodes\SC_pickup.pwn(10270) : warning 213: tag mismatch
C:\Users\Family\Documents\SFRP\SAMP 0.3\gamemodes\SC_pickup.pwn(10275) : warning 213: tag mismatch
and the script doesnt start
|
show me these lines
Re: getting errors with this automatic gate script -
Mattjones17 - 03.01.2010
if(PlayerToPoint(10.0, i, -1754.092163, 757.279907, 23.990942) && OpenGate[i] == 0)
{
MoveObject(Busenter, -1754.091675, 757.228943, 22.894398, 5);
OpenGate[i] = 1;
}
else if(!PlayerToPoint(10.0, i, -1754.092163, 757.279907, 23.990942) && OpenGate[i] == 1)
{
MoveObject(Busenter, -1754.092163, 757.279907, 23.990942, 5);
OpenGate[i] = 0;
}
Re: getting errors with this automatic gate script -
Mattjones17 - 04.01.2010
bump
sa-mp-server is closing whilst loading the GM
Re: getting errors with this automatic gate script -
Mattjones17 - 04.01.2010
bump
Re: getting errors with this automatic gate script -
MadeMan - 04.01.2010
Show your PlayerToPoint function define.
Something like this:
It should be in your script somewhere.
Re: getting errors with this automatic gate script -
Mattjones17 - 04.01.2010
stock PlayerToPoint(playerid,Float:radi, Float

x, Float

y, Float

z)
{
if(IsPlayerConnected(playerid))
{
new Float

, Float:y, Float:z;
new Float

x, Float

y, Float

z;
GetPlayerPos(playerid, ox, oy, oz);
x = (ox -px);
y = (oy -py);
z = (oz -pz);
if (((x < radi) && (x > -radi)) && ((y < radi) && (y > -radi)) && ((z < radi) && (z > -radi))) return 1;
}
return 0;
}
Re: getting errors with this automatic gate script -
MadeMan - 04.01.2010
Change the order of 10.0 and i in these lines:
pawn Код:
if(PlayerToPoint(i, 10.0, -1754.092163, 757.279907, 23.990942) && OpenGate == 0)
pawn Код:
else if(!PlayerToPoint(i, 10.0, -1754.092163, 757.279907, 23.990942) && OpenGate == 1)