[Pedido] Nгo iniciar comboio sozinho
#4

PPC_Trucking

COMMAND:comboio(playerid, params[])
{
// Setup local variables
new ConvoyList[750], Name[24], NumMembers, ConvoyStatus[10];

// Send the command to all admins so they can see it
SendAdminText(playerid, "/comboio", params);

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Create the list of convoys with all their data
for (new i; i < MAX_CONVOYS; i++)
{
// Check if this is an empty convoy (not created yet by a player)
if (AConvoys[i][Status] == CONVOY_EMPTY)
{
// Setup data for an empty convoy (one which hasn't been chosen yet)
NumMembers = 0;
format(Name, 24, "nenhum");
format(ConvoyStatus, 10, "vazio");
}
else
{
// Get the name of the convoy-leader
GetPlayerName(AConvoys[i][Members][0], Name, sizeof(Name));
// Calculate the members in the convoy
NumMembers = Convoy_CountMembers(i);
// Set the status of the convoy
switch (AConvoys[i][Status])
{
case CONVOY_OPEN: format(ConvoyStatus, 10, "Aberto");
case CONVOY_FULL: format(ConvoyStatus, 10, "Cheio");
case CONVOY_CLOSED: format(ConvoyStatus, 10, "Fechado");
}
}

// Put all data together to form the content of the entire dialog
format(ConvoyList, sizeof(ConvoyList), "%sLнder: {FFFF00}%s{FFFFFF}, membros: {FFFF00}%i{FFFFFF}, Status: {FFFF00}%s{FFFFFF}\n", ConvoyList, Name, NumMembers, ConvoyStatus);
}

// Show the dialog
ShowPlayerDialog(playerid, DialogSelectConvoy, DIALOG_STYLE_LIST, "Selecione o comboio:", ConvoyList, "Selecionar", "Cancelar");
}
else
return 0;

// Let the server know that this was a valid command
return 1;
}
Reply


Messages In This Thread
Nгo iniciar comboio sozinho - by PiLoTo - 02.08.2014, 02:18
Re: Nгo iniciar comboio sozinho - by Lуs - 02.08.2014, 02:21
Re: Nгo iniciar comboio sozinho - by WLSF - 02.08.2014, 02:23
Re: Nгo iniciar comboio sozinho - by PiLoTo - 02.08.2014, 02:23
Re: Nгo iniciar comboio sozinho - by PiLoTo - 02.08.2014, 02:34
Re: Nгo iniciar comboio sozinho - by Saw_BR - 02.08.2014, 12:38
Re: Nгo iniciar comboio sozinho - by Fenix4000 - 02.08.2014, 15:37
Re: Nгo iniciar comboio sozinho - by PiLoTo - 02.08.2014, 19:50
Re: Nгo iniciar comboio sozinho - by Fenix4000 - 02.08.2014, 20:19
Re: Nгo iniciar comboio sozinho - by PiLoTo - 02.08.2014, 20:36

Forum Jump:


Users browsing this thread: 1 Guest(s)