21.04.2011, 03:00
So i have this code i got from a tutorial the gate works fine but i want it so that it only opens if i use a certain cmd
code i have so far -
code i have so far -
Quote:
#include <a_samp> forward GateCheck(); new AutomaticGate; public OnGameModeInit() { SetTimer("GateCheck", 1000, true); AutomaticGate = CreateObject(186, -766.9352, 92.1028, 192.3989, 0, 0, 0); return 1; } public GateCheck() { for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInRangeOfPoint(i, 10.0, -766.9352, 92.1028, 192.3989)) { MoveObject(AutomaticGate, -766.9352, 92.1028, 192.3989, 5.0); } else { MoveObject(AutomaticGate, -766.9352, 92.1028, 202.3989, 5.0); } } } } |