Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new open[MAX_PLAYERS];
- public TollGate_Open()
- new tollvehicle;
- for(new i=GetMaxPlayers(); i > -1; i--)
- {
- //Iterates through an array of Created Object toll gate
- for(new a; a<sizeof(GatePos); a++)
- {
- //If Player is in range of toll gate AND if open is false
- if(IsPlayerInRangeOfPoint(i, 8.0, GatePos[a][0],GatePos[a][1],GatePos[a][2]))
- {
- tollvehicle = GetPlayerVehicleID(i);
- if(IsPlayerInVehicle(i, tollvehicle) && open[i] != true)
- {
- MoveObject(Gate[a], GatePos[a][0],GatePos[a][1],GatePos[a][2], 5.00, GatePos[a][3], 0.0, GatePos[a][5]);
- open[i] = true;
- GivePlayerMoney(i,-20);
- GameTextForPlayer(i,"$20\nToll Paid",3000,4);
- }
- }
- //Move back the toll gate to its closed state
- 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;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement