18.08.2009, 18:10
Remember to add:
All to the top of your script.
Instead of adding "public OnPlayerCommandText(playerid, cmdtext[])"
Put that inside the "public OnPlayerCommandText(playerid, cmdtext[])"
And add:
To the bottom of your script.
Код:
new GatePos; //Checks if the gate is open or closed new AreaTimer; //Variable assigned to the Area timer forward Area(playerid); //Script initiated for the timer
Instead of adding "public OnPlayerCommandText(playerid, cmdtext[])"
Код:
if (strcmp("/secret", cmdtext, true, 10) == 0) { if(GatePos==0) { if(PlayerToPoint(15.0, playerid, -2468.3889, 1547.0945, 23.8359)) { MoveObject(cozgate, -2468.371338, 1547.240723, 24.030167, 2.0); GatePos=1; AreaTimer=SetTimerEx("Area",1,true,"d",playerid); } else { SendClientMessage(playerid,0xFFFF00AA,"You are not near the gate!"); } } else { if(PlayerToPoint(15.0, playerid, -2468.3889, 1547.0945, 23.8359)) { MoveObject(cozgate, -2468.352051, 1547.224243, 21.280209, 2.0); GatePos=0; KillTimer(AreaTimer); } else { SendClientMessage(playerid,0xFFFF00AA,"You are not near the gate!"); } } return 1; }
And add:
Код:
public Area(playerid) { if(PlayerToPoint(15.0, playerid, -2468.3889, 1547.0945, 23.8359)) { } else { MoveObject(cozgate, -2468.352051, 1547.224243, 21.280209, 2.0); GatePos=0; KillTimer(AreaTimer); } return 1; }