SA-MP Forums Archive
Gate - 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)
+--- Thread: Gate (/showthread.php?tid=479919)



Gate - Sledgehammer - 07.12.2013

Gates
Hello, I was trying to make my /gate command to work with two gates but the 2nd one doesn't want to work. Please help me out. Frist one works perfect.

pawn Код:
COMMAND:gate(playerid, params[])
{
    if(PlayerInfo[playerid][pFaction] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid,7.0,1544.4863,-1627.2356,13.6044))
        {
            MoveObject(LSPDbar,1544.6999500,-1630.8000500,13.3000000, 0.0001, 0.0000000, 9.0000000, 90.0000000);
            timer[playerid] = SetTimerEx("gateclose",10000,false,"i",playerid);
        }
        else if(IsPlayerInRangeOfPoint(playerid,7.0,1588.1267,-1637.9401,13.4202))
        {
            MoveObject(LSPDGate,1599.1999500,-1638.0999800,14.8001000, 0.0001); //object(airportgate) (1)
            timer[playerid] = SetTimerEx("gateclose2",10000,false,"i",playerid);
        }
    }
    return 1;
}
Thanks for those have helped, I shall give you one +Rep for helping as an reward.

Thanks for advanced.

Kind Regards,
Death 1300.


Re: Gate - Sledgehammer - 07.12.2013

Bump?


Re: Gate - Mitchy - 07.12.2013

i dont understand this: 0.0001+1599.1999500,-1638.0999800,14.8001000, 0.0001


Re: Gate - Sledgehammer - 07.12.2013

x,y,z,how fast....


Re: Gate - Voxel - 07.12.2013

Remove the 0.0001+ and check if the coords are correct for both is playerinrangeifpoint and the coords for the gate.

Goodluck!


Re: Gate - batonsa - 07.12.2013

I don't see an issue here with your code. It could be either the coords or the gate name variables are conflicting somehow. And you could just use '1560.2' instead of '0.0001+1599.1999500', just for the sake of simplicity.

Would be cool if you clarified aswell what you dont mean under 'doesn't want to work'.
Does the gate even move when the command is sent?