Help with ZCMD gates
#1

Here's my script, it's not working properly - gate opens but never comes back.

pawn Код:
CMD:westman(playerid, params[])
{
    if(WestStatus == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 2313.5000000,-1218.0999800,22.7000000))
        {
            MoveObject(WestGate1, 2313.5000000,-1218.0999800,19.2000000, 5);
            SendClientMessage(playerid, 0xEF994300, "The gate is opening!");
            WestStatus = 1;
        }
        else
        {
            SendClientMessage(playerid, 0xEF994300, "You are not in range of the gate!");
        }
    }
    else if(WestStatus == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 2313.5000000,-1218.0999800,22.7000000))
        {
            MoveObject(WestGate1,  1544.6600341797, -1623.9599609375, 13.10000038147, 5);
            SendClientMessage(playerid, 0xEF994300, "The gate is closing!");
            WestStatus = 0;
        }
        else
        {
            SendClientMessage(playerid, 0xEF994300, "You are not in range of a gate!");
        }
    }
    return 1;
    }
Reply
#2

Fixed, close.
Reply
#3

Info is 'gate is closing' ?

pawn Код:
CMD:westman(playerid)
{
    if(!IsPlayerInRangeOfPoint(playerid, 7.0, 2313.5000, -1218.0999, 22.7000)) SendClientMessage(playerid, 0xEF994300, "You are not in range of the gate!");
    else{
        WestStatus = !WestStatus;
        switch(WestStatus)
        {
            case 0:
            {
                MoveObject(WestGate1, 2313.5000,-1218.0999,19.2000, 5.0);
                SendClientMessage(playerid, 0xEF994300, "The gate is opening!");
            }
            default:
            {
                MoveObject(WestGate1, 1544.6600, -1623.9599, 13.1000, 5.0);
                SendClientMessage(playerid, 0xEF994300, "The gate is closing!");
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)