30.04.2014, 23:29
Is it even possible to teleport to a house ID displayed in a dialog if the houses are being looped?
I need it so when an administrator clicks "Visit", it teleports them to the house they select in the list.
I can sort everything else out just not sure if it's possible, and if it is possible how do I know how many switch cases to make under OnDialogResponse?
pawn Код:
CMD:houses(playerid, params[])
{
new string[500];
if(!IsPlayerLoggedIn(playerid))
{
SendClientMessage(playerid, COLOR_RED, "Error"White": You are restricted from using commands until you log in.");
return 1;
}
if(PlayerInfo[playerid][pAdminLevel] < 1)
{
SendClientMessage(playerid, COLOR_RED, "Error"White": You do not have the authority to use this command.");
return 1;
}
if(!AdminDuty[playerid])
{
SendClientMessage(playerid, COLOR_RED, "Error"White": You are not on duty as an Administrator (/aduty).");
return 1;
}
for(new i = 1; i < MAX_HOUSES; i++)
{
if(HouseInfo[i][hHouseID] == i)
{
format(string, sizeof(string), "%sID: %d - Address: %s - Owner: %s\n", string, HouseInfo[i][hHouseID], HouseInfo[i][hAddress], HouseInfo[i][hOwner]);
}
}
ShowPlayerDialog(playerid, DIALOG_HOUSES, DIALOG_STYLE_LIST, ""Lightblue"House List", string, "Visit", "Cancel");
return 1;
}
I can sort everything else out just not sure if it's possible, and if it is possible how do I know how many switch cases to make under OnDialogResponse?