Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2020
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. enum e_cp
  2. {
  3. e_Location[10],
  4. Float: cordX,
  5. Float: cordY,
  6. Float: cordZ
  7. }
  8. static const checkVariables[][e_cp] =
  9. {
  10. {"Spin Place", 2128.6445, 1326.6934,10.8416},
  11. {"Crate Place", 404.8218,2445.1238,16.5000}
  12. };
  13.  
  14.  
  15. CMD:locations(playerid, params[])
  16. {
  17. #pragma unused params
  18.  
  19. gString[0] = EOS;
  20. format(gString, sizeof gString, "Destinatie\tDistance\n");
  21.  
  22. for(new i = 0; i < sizeof(checkVariables); i ++)
  23. {
  24. format(gString, sizeof gString, "%s%s\t%0.2fm\n", gString, checkVariables[i][e_Location], GetPlayerDistanceFromPoint(playerid, checkVariables[i][cordX], checkVariables[i][cordY], checkVariables[i][cordZ]));
  25. }
  26. ShowPlayerDialog(playerid, DIALOG_LOCATIONS, DIALOG_STYLE_TABLIST_HEADERS, "Locations", gString, "Select", "Cancel");
  27.  
  28. return 1;
  29. }
  30.  
  31. case DIALOG_LOCATIONS:
  32. {
  33. if(!response) return 1;
  34.  
  35. SetPlayerCheckpoint(playerid, checkVariables[listitem][cordX], checkVariables[listitem][cordY], checkVariables[listitem][cordZ]);
  36.  
  37. gString[0] = EOS;
  38. format(gString, sizeof gString, "Ti-a fost pus un checkpoint catre locatia aleasa de tine. (%s) distanta (%0.2fm)", checkVariables[listitem][e_Location], GetPlayerDistanceFromPoint(playerid, checkVariables[listitem][cordX], checkVariables[listitem][cordY], checkVariables[listitem][cordZ]));
  39. SendClientMessage(playerid, COLOR_YELLOW, gString);
  40.  
  41. CP[playerid] = 43;
  42.  
  43. return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement