Gates and Elevators
#1

Hello. I want to make 1 gate and 1 elevator.

I have got the coцrdinates.

Here they are:

Lift Up:
1536.267578125
-1067.2705078125
180.0355682373

Lift Down:
1536.267578125
-1067.2705078125
23.970704269409

Gate Closed:
1528.2564697266
-1075.6926269531
184.11711120605

Gate Open:
1528.2564697266
-1075.6926269531
176.11711120605

But now is the question, what is the piece of code to let this gates work with a command? like /opengate /closegate and /liftup and /liftdown
Reply
#2

At the top of your gamemode:
Код:
new mygates;//Gates variable
At the OnGameModeInit:
Код:
mygates = CreateObject(...)//paste here id of your object, coordinates and rotations for closed gates
And at OnPlayerCommandText:
Код:
if(!strcmp(cmdtext,"/opengate",true))//Will open your gates
{
  MoveObject(mygates, 1528.2564697266,-1075.6926269531,176.11711120605, 2.5);
  return 1;
}
if(!strcmp(cmdtext,"/close",true))//Will close your gates
{
  MoveObject(mygates, 1528.2564697266,-1075.6926269531,184.11711120605, 2.5);
  return 1;
}
Do the same stuff for lift by yourself, i think it will be easy now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)