MoveObject keeps on going for all eternity
#1

pawn Код:
CMD:gate(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /gate [password]");

    new string[128];
    new iName[24], gate = -1;
    GetPlayerName(playerid, iName, 24);
    for(new i = 0; i != MAX_GATES; i++ )
        if(GateInfo[i][gCreated] == 1)
            if(strval(params) == GateInfo[i][gPassword])
            {
                gate = i; break;
            }
           
    if(gate != -1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 15.0, GateInfo[gate][gX], GateInfo[gate][gY], GateInfo[gate][gZ]))
        {
            if(GateInfo[gate][gStatus] == GATE_CLOSED)
            {
                MoveObject(GateInfo[gate][gObject], GateInfo[gate][gXM], GateInfo[gate][gYM], GateInfo[gate][gZM], GateInfo[gate][gSpeed]);
                format(string, sizeof(string), "* %s uses their remote control to open the gate.", iName);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE);
            }
            else
            {
                MoveObject(GateInfo[gate][gObject], GateInfo[gate][gX], GateInfo[gate][gY], GateInfo[gate][gZ], GateInfo[gate][gSpeed]);
                format(string, sizeof(string), "* %s uses their remote control to close the gate.", iName);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not near any gate!");
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "Incorrect password!");
        return 1;
    }
    return 1;
}
The object keeps moving when I use the command, and I've tried placing returns inside the gStatus brackets, and alot of other things, but nothing seems to be fixing it.
Reply


Messages In This Thread
MoveObject keeps on going for all eternity - by reckst4r - 17.02.2013, 15:10
Re: MoveObject keeps on going for all eternity - by Backwardsman97 - 17.02.2013, 16:12
Re: MoveObject keeps on going for all eternity - by reckst4r - 17.02.2013, 16:18

Forum Jump:


Users browsing this thread: 1 Guest(s)