Server address: server.convoytrucking.netYou can download SA-MP 0.3.7 here: http://www.sa-mp.com/download.php

new open[MAX_PLAYERS];

open[playerid] = true;

if(!open[i]){

else if(open[i]){

if(!IsPlayerInRangeOfPoint(i, 8.0, GatePos[a][3], GatePos[a][4], GatePos[a][5])) { if(!open[i]) { MoveObject(Gate[a], GatePos[a][0],GatePos[a][1],GatePos[a][2], 5.00, GatePos[a][3], GatePos[a][4], GatePos[a][5]); open[i] = false; }}

ChangeCode: [Select]if(!open[i]){toCode: [Select]else if(open[i]){I think open should be true here right?

Try getting the range of the player before closing the gatesomething like this but not exactly.Code: [Select] if(!IsPlayerInRangeOfPoint(i, 8.0, GatePos[a][3], GatePos[a][4], GatePos[a][5])) { if(!open[i]) { MoveObject(Gate[a], GatePos[a][0],GatePos[a][1],GatePos[a][2], 5.00, GatePos[a][3], GatePos[a][4], GatePos[a][5]); open[i] = false; }}

public TollGate_Open(){ for(new i=GetMaxPlayers(); i > -1; i--) { for(new a; a<sizeof(GatePos); a++) { //If Player is in range of toll gate AND if open is false if(IsPlayerInRangeOfPoint(i, 6, GatePos[a][0],GatePos[a][1],GatePos[a][2]) && GetPlayerVehicleSeat(i) == 0) { if(TollPaid[i][a] == 0) { TollPaid[i][a] = 1; MoveObject(Gate[a], GatePos[a][0], GatePos[a][1], GatePos[a][2]+0.1, 0.15, GatePos[a][3], 0.0, GatePos[a][5]); GivePlayerMoney(i,-20); GameTextForPlayer(i,"$20\nToll Paid",3000,4); } } else { //If already paid then close the gate if(TollPaid[i][a] == 1){ MoveObject(Gate[a], GatePos[a][0], GatePos[a][1], GatePos[a][2]-0.01, 0.15, GatePos[a][3], GatePos[a][4], GatePos[a][5]); TollPaid[i][a] = 0; } } } } return 1;}