Guest User

Untitled

a guest
Jan 8th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. if(dialogid == DIALOG_GPS)
  2. {
  3. if(response)
  4. {
  5. if(listitem == 0)// czyli opcja to GPS
  6. {
  7.  
  8. new stationid1 = -1;
  9.  
  10. for(new slotid, Float:distance1 = 10000.0, Float:distance2; slotid != MAX_FUEL_STATIONS; slotid++)
  11. {
  12. distance2 = GetPlayerDistanceFromPoint(playerid, FuelStationPos[slotid][0], FuelStationPos[slotid][1], FuelStationPos[slotid][2]);
  13.  
  14. if(distance2 < distance1)
  15. {
  16. distance1 = distance2;
  17. stationid1 = slotid;
  18. }
  19. SetPlayerCheckpoint(playerid, FuelStationPos[stationid1][1], FuelStationPos[stationid1][1], FuelStationPos[stationid1][2], 3);
  20. SendClientMessage(playerid, 0x00FF00FF, "GPS >>Stacje: {FFFFFF}Najbliższa stacja została zaznaczona czerwonym punktem na mapie!");
  21. }
  22. }
  23. }
  24. return 1;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment