27.06.2011, 23:48
pawn Код:
new bool:gate//On top of your script
gate = CreateObject(2930,320.940551,312.213470,1000.785278,0,0,0.244628,50);//Create the gate with name "gate" ((Inside OnGameModeInit))
if(IsPlayerInRangeOfPoint(playerid,1,321.2952,312.1402,999.1484))//Check if player near the gate((Inside your command ex: /gate))
{
if(gate == false)//If the gate is opened, close it.
{
MoveObject(sdmtd[1],320.953125,313.753906,1000.785278,1);//Move the gate
gate = true;//set the bool
return 1;
}
else//If the gate closed, open it.
{
MoveObject(gate,320.940551,312.213470,1000.785278,1)//Move the gate
gate = false;//set the bool
return 1;
}
}