Put this in a game mode and compile it. Log into rcon in-game and go near the gate to see if it works. If you go far enough from the gate
pawn Код:
new
g_gate,
g_gateTog;
public OnGameModeInit()
{
g_gate = CreateObject(10841, 2890.60, -1963.5, 17.2, 0.0, 0.0, 270.0);
SetTimer("gateCheck", 1000, 1);
return 1;
}
forward gateCheck();
public gateCheck()
{
new p_count;
for(new i; i<MAX_PLAYERS; i++) {
if(IsPlayerAdmin(i)) {
if(IsPlayerInRangeOfPoint(i, 5.0, 2890.60, -1963.5, 17.2)) {
p_count++;
break;
}
}
}
if(p_count) {
g_gateTog = 1;
MoveObject(g_gate, 2890.60, -1963.5, 17.2-5.0, 1.0, 0.0, 0.0, 0.0);
}
else {
g_gateTog = 0;
MoveObject(g_gate, 2890.60, -1963.5, 17.2, 1.0, 0.0, 0.0, 0.0);
}
return 1;
}