Sanady

Untitled

Apr 29th, 2017
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. hook OnPlayerStateChange(playerid, newstate, oldstate)
  2. {
  3. if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
  4. {
  5. for(new i = 0; i < sizeof(GangZone); i++)
  6. {
  7. new Float:VehPos[3];
  8. print("1");
  9. GetVehiclePos(GangZone[i][ZoneVehID], VehPos[0], VehPos[1], VehPos[2]);
  10. print("2");
  11. if(IsPlayerInVehicle(playerid, GangZone[i][ZoneVehID])) continue;
  12. print("2.5");
  13. if(GangZone[i][minX] < VehPos[0] && GangZone[i][maxX] > VehPos[0] && GangZone[i][minY] < VehPos[1] && GangZone[i][maxY] > VehPos[1]) return 0;
  14. print("3");
  15. if(GangZone[i][OwnerTeam] != GetPlayerTeam(playerid))
  16. {
  17. print("4");
  18. GetPlayerPos(playerid, VehPos[0], VehPos[1], VehPos[2]);
  19. print("5");
  20. SetPlayerPos(playerid, VehPos[0], VehPos[1], VehPos[2]);
  21. print("6");
  22. SendError(playerid, "You need to own this turf to drive this vehicle in it!");
  23. return 0;
  24. }
  25. }
  26. }
  27. return 1;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment