06.09.2012, 20:09
(
Последний раз редактировалось Hyperfire; 06.09.2012 в 21:04.
)
Here is what I do with my Area 51 gates script...
First create new variables(or something like that XD)...
Then create the objects...
Then make the command to open the gates(Can be done in other ways also)...
Remember to make a forward for the timer and also a public function...
First the forward...
Then the public function...
That should do it, hope I helped.
First create new variables(or something like that XD)...
Код:
new gate1; new gate2;
Код:
gate1 = CreateObject(2927,215.92999390,1875.50000000,13.89999962,0.00000000,0.00000000,0.00000000); //object(a51_blastdoorr) (D) gate2 = CreateObject(2929,211.85000732,1875.50000000,13.89999962,0.00000000,0.00000000,0.00000000); //object(a51_blastdoorl) (D)
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/hopen", cmdtext, true, 6) == 0) { if(IsPlayerInRangeOfPoint(playerid, 5, 213.8570,1875.4865,13.1470)) { MoveObject(gate1, 219.92999390,1875.50000000,13.89999962, 1);// Opening the gate MoveObject(gate2, 207.85000732,1875.50000000,13.89999962, 1);// Opening the gate SetTimer("TimerName",5000,false); //5000 in milliseconds = 5 Seconds } return 1; } return 0; //I put this return here because for some reason my code didn't want to work without it lol }
First the forward...
Код:
forward TimerName(playerid);
Код:
public TimerName(playerid) { MoveObject(gate1, 215.92999390,1875.50000000,13.89999962, 1);// Moving the gate MoveObject(gate2, 211.85000732,1875.50000000,13.89999962, 1);// Moving the gate }