Originally Posted by KnooL
on top of the script:
OnFilterScriptInit / OnGameModeInit:
pawn Код:
gate = CreateObject(986,-302.628,1507.450,76.070,0.0,0.0,0.0);
On the bottom of your script:
pawn Код:
forward CheckGate(); public CheckGate() { for(new i = 0; i < GetMaxPlayers(); i++) { if(!IsPlayerConnected(i)) continue; if(IsPlayerInRangeOfPoint(i, 10.0, -302.628,1507.450,76.070) && OpenGate[i] == 0) { MoveObject(gate,-293.828,1507.450,76.070,10) OpenGate[i] = 1; } else if(!IsPlayerInRangeOfPoint(i, 10.0, -302.628,1507.450,76.070) && OpenGate[i] == 1) { MoveObject(gate,-302.628,1507.450,76.070,10) OpenGate[i] = 0; } }
This one checks if a player is near the object.
|