Gates and Elevators - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Gates and Elevators (
/showthread.php?tid=119307)
Gates and Elevators -
thecutkiller - 07.01.2010
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
Re: Gates and Elevators -
Norck - 07.01.2010
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