and this command works using the same dialog
COMMAND
howtheway(playerid, params[])
{
if(PlayerInfo[playerid][pAdminlevel] == 0 && PlayerInfo[playerid][pModLevel] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You must be Moderator to use this command.");
new user;
if(sscanf(params, "u", user)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /showtheway [playerid]");
if(user == INVALID_PLAYER_ID) sscanf(params, "i", user);
if(user > MAX_PLAYERS) user = DeterminePlayerID(user);
if(!IsPlayerConnected(user)) return SendClientMessage(playerid, COLOR_GREY, "Invalid playerID (Submitted playerID is not connected).");
if(IsPlayerNPC(user)) return SendClientMessage(playerid, COLOR_GREY, "Invalid playerID (Submitted playerID points at NPC).");
PlayerInfo[playerid][pShowtheway_ID] = user;
format(gVar3000, sizeof(gVar3000), "%s", EOS);
for(new i = 0; i != sizeof(Locs); i++)
{
if(isnull(gVar3000)) format(gVar3000, sizeof(gVar3000), "%s", Locs[i][locName]);
else format(gVar3000, sizeof(gVar3000), "%s\n%s", gVar3000, Locs[i][locName]);
}
ShowPlayerDialog(playerid, DIALOG_SHOW_LOCATIONS, DIALOG_STYLE_LIST, "{FF9900}Locations", gVar3000, "Mark", "Cancel");
return format(gVar3000, sizeof(gVar3000), "%s", EOS);
}