28.08.2012, 20:52
first here is what I do... It can be done in other ways also.
first, creating the variable for the gate...
The creating the object(gate)
Then the command to open the gate(please note that when you do it this way you must use different commands for every gate)
Then, if you want, a command to close the gate, or you can make a timer to close it.
first, creating the variable for the gate...
Код:
new gate1; new gate2;
Код:
public OnFilterScriptInit()/public OnGameModeInit() { 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) // The /open command { if(IsPlayerInRangeOfPoint(playerid, 5, 213.8570,1875.4865,13.1470)) { MoveObject(gate1, 219.92999390,1875.50000000,13.89999962, 1); MoveObject(gate2, 207.85000732,1875.50000000,13.89999962, 1); } return 1; } }
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/hclose", cmdtext, true, 7) == 0)// The /close command { if(IsPlayerInRangeOfPoint(playerid, 5, 213.8570,1875.4865,13.1470)) { MoveObject(gate1, 215.92999390,1875.50000000,13.89999962, 1);// Moving the gate MoveObject(gate2, 211.85000732,1875.50000000,13.89999962, 1);// Moving the gate } return 1; } }