26.07.2012, 20:14
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:
Hope it works now
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; }