I have a problem opening a gate
#2

Add at the top where you have all your variables
pawn Код:
new gate;
Add to ongamemodeinit
pawn Код:
gate = 1;
Command
pawn Код:
if (strcmp(cmdtext, "/gate", true)==0)
{
    if(IsPlayerInRangeOfPoint(playerid,20,782.09,-1384.78,12.75))
    {
        if(gate == 0)
        {
            MoveObject(gate,773.91998291016, -1384.759765625, 12.704795837402, 3.0);
            SendClientMessage(playerid, COLOR_YELLOW, "Gate has opened");
            gate = 1;
        }
        else
        {
            MoveObject(gate,782.34002685547, -1384.7600097656, 12.704795837402, 3.0)
            SendClientMessage(playerid, COLOR_YELLOW, "Gates have closed");
            gate = 0;
        }
    }
    return 1;
}
You must have a check to see if the gate is open or closed.
Reply


Messages In This Thread
I have a problem opening a gate - by RASTAFARIAN - 19.10.2010, 03:38
Re: I have a problem opening a gate - by CuervO - 19.10.2010, 03:59
Re: I have a problem opening a gate - by RASTAFARIAN - 19.10.2010, 04:25
Re: I have a problem opening a gate - by RASTAFARIAN - 19.10.2010, 04:35
Re: I have a problem opening a gate - by [Lsrcr]Rafa - 19.10.2010, 06:20
Re: I have a problem opening a gate - by RASTAFARIAN - 19.10.2010, 10:24
Re: I have a problem opening a gate - by Mike_Peterson - 19.10.2010, 10:37

Forum Jump:


Users browsing this thread: 1 Guest(s)