Automatic Gates not doing anything
#1

Hi, Ive made automatic gates, So when i goto LSPD the gates open themselfs rather than a command,
So anyway heres my code, It compiles with no errors, But when i get to the coords, Nothing happens, The gate stays closed...

pawn Код:
forward automaticgates(i,playerid);
forward lspdclosing();

public lspdclosing()
{
    MoveObject(lspdgate,1588.5617, -1638.0871, 12.7200,1);
}

public automaticlspd(i,playerid)
{
  if(PlayerToPoint(20.0, i,1588.3677,-1636.7367,13.4087))
  {
    MoveObject(lspdgate,1588.5617, -1638.0871, 5.7200,2);
    SetTimer("lspdclosing",5000,false);
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, "You are not near a openable gate");
    }
}
I dont know that much about coding and i know ive done something wrong, Maybe you can tell me :P
Reply
#2

do you use a timer ?
https://sampwiki.blast.hk/wiki/SetTimer
Reply
#3

Dude, No Offence but, Are you blind? You can see the timer in the code...
Reply
#4

And what is calling your public automaticlspd(i,playerid) ?
Reply
#5

Oh.. er.. nothing because i forgot where to put the PlayerToPoint so i made that callback
Reply
#6

pawn Код:
new timer;
forward automaticgates(playerid);
public automaticlspd(playerid)
//////
if(PlayerToPoint(20.0, playerid,1588.3677,-1636.7367,13.4087))
////// OnPlayerConnect(playerid)
timer = SetTimerEx("automaticgates", 3000, true, "d", playerid);
//// OnPlayerDisconnect(playerid, reason)
KillTimer(timer);
Reply
#7

Код:
C:\Users\Torran\Documents\Server Stuff\MTRP\mtrp-final.pwn(39569) : warning 235: public function lacks forward declaration (symbol "lspdclosing")
C:\Users\Torran\Documents\Server Stuff\MTRP\mtrp-final.pwn(39574) : warning 235: public function lacks forward declaration (symbol "automaticlspd")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:      9496 bytes
Code size:     1537000 bytes
Data size:     7534608 bytes
Stack/heap size:   16384 bytes; estimated max. usage=4484 cells (17936 bytes)
Total requirements: 9097488 bytes

2 Warnings.
Reply
#8

Woops, I meant

pawn Код:
forward automaticlspd(playerid);
public automaticlspd(playerid)
For the first error, you are using the code posted in your first post right ?
And for the size warning at the bottom read this
http://forum.sa-mp.com/index.php?topic=79810.0
Reply
#9

The same errors cause its the same as what you said before,
Do you mean: forward automaticlspd(playerid);
or do you mean: public automaticgates(playerid);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)