Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. CMD:airport(playerid, params[])
  2. {
  3. new
  4. teleid;
  5.  
  6. if (sscanf(params, "d", teleid))
  7. return ShowAirportDialog(playerid), COMMAND_SUCCESS;
  8.  
  9. if (teleid < 1 || teleid > 4)
  10. return MsgTag(playerid, TAG_ERROR, "The airport ID must be between 1 and 4."), COMMAND_FAILURE;
  11.  
  12. TeleportPlayer(playerid, gAirportTeleports[teleid - 1][0], gAirportTeleports[teleid - 1][1], gAirportTeleports[teleid - 1][2]);
  13.  
  14. return COMMAND_SUCCESS;
  15. }
  16.  
  17. ShowAirportDialog(playerid)
  18. {
  19. Debug("ShowAirportDialog(playerid = %d, position_x = %f, position_y = %f, position_z = %f, rotation = %f, interior = %d)", playerid, position_x, position_y, position_z, rotation, interior);
  20.  
  21. inline Response(pid, dialogid, response, listitem, string:inputtext[])
  22. {
  23. #pragma unused pid, dialogid, response, listitem, inputtext
  24.  
  25. if (!response)
  26. return 1;
  27.  
  28. TeleportPlayer(playerid, gAirportTeleports[listitem][0], gAirportTeleports[listitem][1], gAirportTeleports[listitem][2]);
  29. MsgTag(playerid, TAG_INFO, "You have teleported to airport " COLOR_EMBED_LIGHTYELLOW "%d" COLOR_EMBED_WHITE ".", listitem + 1);
  30. }
  31.  
  32. Dialog_ShowCallback(playerid, using inline Response, DIALOG_STYLE_TABLIST_HEADERS, "Airport list",
  33. "\
  34. Command\tLocation\n\
  35. /airport 1\tLos Santos International\n\
  36. /airport 2\tEaster Bay Airport\n\
  37. /airport 3\tLas Venturas Airport\n\
  38. /airport 4\tVerdant Meadows\
  39. ", "Teleport", "Cancel");
  40.  
  41. return 1;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement