13.03.2010, 16:33
gates donґt seem to work, i keep getting errorґs
I have no idea where to put
and
I have no idea where to put
Код:
public CheckGate() { new c_gate_status; for(new i;i<MAX_PLAYERS;i++) { if(!IsPlayerConnected(i)) continue; /* You would only use this if you're using SA-MP v0.2x or lower if(PlayerToPoint(10.0, i, closed_X, closed_Y, closed_Z))c_gate_status = 1; */ if(IsPlayerInRangeOfPoint(i,10.0,closed_X,closed_Y,closed_Z))c_gate_status = 1; } if(c_gate_status)MoveObject(c_gate, open_X, open_Y, open_Z,Moving Speed); else MoveObject(c_gate, closed_X, closed_Y, closed_Z,Moving Speed); }
Код:
PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z) { new Float:oldpos[3], Float:temppos[3]; GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]); temppos[0] = (oldpos[0] -X); temppos[1] = (oldpos[1] -Y); temppos[2] = (oldpos[2] -Z); if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius))) { return true; } return false; }