Guys what is wrong with this Elevator?
#4

you'll have to check if the elevator is up or down, you can do this with a second variable.

like when you start the server, you make a new variable like this:
and you only need one object, like this:
Код:
new elevatorstate = 0;
OnGameModeInit{
new elevator = CreateObject(986, 280.46, 1822.38, 17.16,   90.00, 0.00, 90.00);
}
CMD:elevup(playerid,params[])
{
    if(gTeam[playerid] == Team_Stars)
    {
        if(elevatorstate == 0){//this will happend if none have said the command before
        MoveObject(elevator,280.46, 1822.38, 17.16,   90.00, 6, 3);//and here it should be a , instead of - i think
        elevatorstate = 1;
        }
        else{// and if the elevatorstate not is 0 it have to be 1 so then this else block will be called
        MoveObject(elevator,291.34, 291.34, 1822.41, 17.16,   90.00, 6, 3);//and here it should be a , instead of - i think
        elevatorstate = 0;//this sets the elevatorstate to down(or wich positio it is)
        }
        SetTimer("up",2000,true);
    }
    return 1;
}
Hope it works now
Reply


Messages In This Thread
Guys what is wrong with this Elevator? - by Gangster-rocks - 26.07.2012, 19:29
Re: Guys what is wrong with this Elevator? - by Marlon_Lorran - 26.07.2012, 19:40
Re: Guys what is wrong with this Elevator? - by Gangster-rocks - 26.07.2012, 19:58
Re: Guys what is wrong with this Elevator? - by Ranama - 26.07.2012, 20:14
Re: Guys what is wrong with this Elevator? - by fury14 - 26.07.2012, 21:21
Re: Guys what is wrong with this Elevator? - by Gangster-rocks - 27.07.2012, 13:23

Forum Jump:


Users browsing this thread: 1 Guest(s)