Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:airport(playerid, params[])
- {
- new
- teleid;
- if (sscanf(params, "d", teleid))
- return ShowAirportDialog(playerid), COMMAND_SUCCESS;
- if (teleid < 1 || teleid > 4)
- return MsgTag(playerid, TAG_ERROR, "The airport ID must be between 1 and 4."), COMMAND_FAILURE;
- TeleportPlayer(playerid, gAirportTeleports[teleid - 1][0], gAirportTeleports[teleid - 1][1], gAirportTeleports[teleid - 1][2]);
- return COMMAND_SUCCESS;
- }
- ShowAirportDialog(playerid)
- {
- 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);
- inline Response(pid, dialogid, response, listitem, string:inputtext[])
- {
- #pragma unused pid, dialogid, response, listitem, inputtext
- if (!response)
- return 1;
- TeleportPlayer(playerid, gAirportTeleports[listitem][0], gAirportTeleports[listitem][1], gAirportTeleports[listitem][2]);
- MsgTag(playerid, TAG_INFO, "You have teleported to airport " COLOR_EMBED_LIGHTYELLOW "%d" COLOR_EMBED_WHITE ".", listitem + 1);
- }
- Dialog_ShowCallback(playerid, using inline Response, DIALOG_STYLE_TABLIST_HEADERS, "Airport list",
- "\
- Command\tLocation\n\
- /airport 1\tLos Santos International\n\
- /airport 2\tEaster Bay Airport\n\
- /airport 3\tLas Venturas Airport\n\
- /airport 4\tVerdant Meadows\
- ", "Teleport", "Cancel");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement