public OnPlayerSpawn(playerid)
{
if(GetPlayerTeam(playerid) == 0) ShowPlayerDialog(playerid, DIALOG_SELECT_PLANE, DIALOG_STYLE_LIST, "Scegli un aeroplano in questa lista", "Boeing 737 800\nLockheed C5 Galaxy\nDeHavilland C7 Caribou\nCessna 172\nDouglas C3\nBombardier Learjet 35\nOracle Stunt Plane\nSirosky S-61\nSirosky HH-60\nBell 206 Jet Ranger\nSA 315B Lama", "Spawn", "");
else if(GetPlayerTeam(playerid) == 1) PutPlayerInVehicle(playerid, CreateVehicle (485,BAGAGLIX, BAGAGLIY, BAGAGLIZ, 0, 1, 1, 1000000), 0);
else
{
new string[256];
for(new i=0;i<MAX_PLAYERS;i++)
{
if(Lavoro[i] == LAVORO_PILOTA && AereoDiLinea[playerid] == 1)
{
new name[128];
if(Destinazione[i] == 0) format(name,sizeof(name), "%s - San Francisco", PlaneName[i]);
else format(name,sizeof(name), "%s - Las Vegas", PlaneName[i]);
format(string,sizeof(string), "%s%s\n", string, name);
}
}
if(!strlen(string)) { ShowPlayerDialog(playerid, DIALOG_DIE, DIALOG_STYLE_LIST, "Nessun volo di linea disponibile", "Scegli un altro personaggio", "OK", ""); }
Lavoro[playerid] = LAVORO_ALTRO;
ShowPlayerDialog(playerid, DIALOG_SELECT_FLIGHT, DIALOG_STYLE_LIST, "Scegli un volo di linea", string, "Spawn", "");
}
return 1;
}
Your using DIALOG_STYLE_LIST under OnPlayerSpawn this means they respond to the dialog by clicking on a list item when they spawn...Wheres the rest of the code. (Hint: OnDialogResponse)
Regardless that code needs a clean up badly (C# uses 4 spaces not 2 spaces) and how can you be getting the length of a string from the planes in the list all in that code? Im suprised it compiles. Learn how to switch dialog and list item case's and use them. www.wiki.sa-mp.com can be very useful..Use it as your scripting ******. |