Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hook OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
- {
- for(new i = 0; i < sizeof(GangZone); i++)
- {
- new Float:VehPos[3];
- print("1");
- GetVehiclePos(GangZone[i][ZoneVehID], VehPos[0], VehPos[1], VehPos[2]);
- print("2");
- if(IsPlayerInVehicle(playerid, GangZone[i][ZoneVehID])) continue;
- print("2.5");
- if(GangZone[i][minX] < VehPos[0] && GangZone[i][maxX] > VehPos[0] && GangZone[i][minY] < VehPos[1] && GangZone[i][maxY] > VehPos[1]) return 0;
- print("3");
- if(GangZone[i][OwnerTeam] != GetPlayerTeam(playerid))
- {
- print("4");
- GetPlayerPos(playerid, VehPos[0], VehPos[1], VehPos[2]);
- print("5");
- SetPlayerPos(playerid, VehPos[0], VehPos[1], VehPos[2]);
- print("6");
- SendError(playerid, "You need to own this turf to drive this vehicle in it!");
- return 0;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment