getting errors with this automatic gate script
#1

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
Reply
#2

add
pawn Код:
forward BusEnter();//Global Variable
+
moveobject u put is wrong
Код:
MoveObject(objectid, x, y, z , speed);
Reply
#3

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
Reply
#4

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
Reply
#5

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;
}
Reply
#6

bump

sa-mp-server is closing whilst loading the GM
Reply
#7

bump
Reply
#8

Show your PlayerToPoint function define.

Something like this:

pawn Код:
PlayerToPoint(...)
{
    ...
}
It should be in your script somewhere.
Reply
#9

stock PlayerToPoint(playerid,Float:radi, Floatx, Floaty, Floatz)
{
if(IsPlayerConnected(playerid))
{
new Float, Float:y, Float:z;
new Floatx, Floaty, Floatz;
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;
}
Reply
#10

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)