06.01.2013, 15:00
I was Created 1 gates its work but i want add 1 another gates too and i don't know how to add another gates?
There is script.
and I want put this :
Now PLease Tell me how to make 2nd gates.
and I am using that scriipt : https://sampforum.blast.hk/showthread.php?tid=202668
There is script.
Код:
SetTimer("GateCheck", 800, true); //This is used to create the timer. The "GateCheck" is the callback we'll be using, // the '800' is the amount of milliseconds between each call and the 'true' indicates that this timer is looping endlessly gate = CreateObject(971, 2335.18, 2443.37, 7.06, 0.00, 0.00, 60.00); //'gate = CreateObject(...);' = Assigns the object id of the gate to the 'gate' variable //978 = object model id < change it to the model id you use for your gate // 8.0, 3.0, 10.0 = coordinates of the gate // 0.0, 0.0, 0.0 = Rotation of the gate. None in this case.
Код:
forward GateCheck(); public GateCheck() { for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) if(IsPlayerInRangeOfPoint(i, 10.0, 2335.18, 2443.37, 7.06)) //Check if any player is in the area. Replace '8.0, 3.0, 10.0' with your own coordinates of your closed gate. { if(gateopen == false) // If the gate isn't open... { MoveObject(gate, 2335.18, 2443.37, -5.00, 2.5); //Then open it! Change '32.0, 12.0, 10.0' to the coordinates of your opened gate. gateopen = true; // Setting this to true indicates it's open(ing) } return; //This closes the callback } } //This is called if nobody has been found near the gate. Obviously, because 'return' would fully close the function and this wouldn't be used then. if(gateopen == true) //If the gate IS open, but there's no one near.. { MoveObject(gate, 2335.18, 2443.37, 7.06, 2.5); // Change the '8.0, 3.0, 10.0' to the coordinates of your gate when it's closed. gateopen = false; //This indicates the gate is closed again. Or at least, closing. } }
Код:
gate = CreateObject(971, 2293.9788,2498.7854,3.3076, 0.00, 0.00, 90.00);
and I am using that scriipt : https://sampforum.blast.hk/showthread.php?tid=202668