[Ajuda] Sу aparece o id 0?
#1

Criei isso aqui, mas na frente do nome do player, sу mostra o id 0, sendo que meu id й outro, o que tem de errado?

PHP код:
COMMAND:participantes(playeridparams[])
{
    
// Setup local variables
    
new Name[24], MemberList[2000], Convoy;
    
// Send the command to all admins so they can see it
    
SendAdminText(playerid"/participantes"params);
    
// Check if the player has logged in
    
if (APlayerData[playerid][LoggedIn] == true)
    {
        
        
// Check if the member is in a convoy
        
if (APlayerData[playerid][InConvoy] == true)
        {
            
            
// Get the convoyID of the member
            
Convoy APlayerData[playerid][ConvoyID];
            
// Loop through all members
            
for (new iCONVOY_MAX_MEMBERSi++)
            {
                
                
// Check if this player is connected
                
if (IsPlayerConnected(i))
                {
                    
                    if (
AConvoys[Convoy][Members][i] != -1// Check if this member-spot is occupied
                    
{
                        
                        
// Get the name of the member
                        
GetPlayerName(AConvoys[Convoy][Members][i], Namesizeof(Name));
                        
// Add the membernames to the list
                        
format(MemberList2000"%s%s (ID: %i)\n"MemberListNamei);
                    }
                }
                
ShowPlayerDialog(playeridDialogConvoyMembersDIALOG_STYLE_MSGBOX"Membros do comboio"MemberList"OK""");
            }
        }
        else
        
SendClientMessage(playerid0xFF0000FF"Nгo йs do comboio.");
    }
    else
    return 
0;
    return 
1;

Reply
#2

Eu nao estou a perceber o que esse comando faz. Entao mas aparece o nome certo mas o ID errado ou sу aparece o do ID 0?

Explica um pouco melhor o que se passa e o que deveria se passar.
Reply
#3

Tenta ae

pawn Код:
COMMAND:participantes(playerid, params[])
{
    // Setup local variables
    new Name[24], MemberList[2000], Convoy;

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

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
         


        // Check if the member is in a convoy
        if (APlayerData[playerid][InConvoy] == true)
        {
             


            // Get the convoyID of the member
            Convoy = APlayerData[playerid][ConvoyID];

            // Loop through all members
            for(new i = 0; i < CONVOY_MAX_MEMBERS; i++)
            {
                 

                // Check if this player is connected
                if (IsPlayerConnected(i))
                {
                     


                    if (AConvoys[Convoy][Members][i] != -1) // Check if this member-spot is occupied
                    {
                         


                        // Get the name of the member
                        GetPlayerName(AConvoys[Convoy][Members][i], Name, sizeof(Name));
                        // Add the membernames to the list
                        format(MemberList, 2000, "%s%s (ID: %i)\n", MemberList, Name, i);
                    }
                }

                ShowPlayerDialog(playerid, DialogConvoyMembers, DIALOG_STYLE_MSGBOX, "Membros do comboio", MemberList, "OK", "");
            }
        }
        else
        SendClientMessage(playerid, 0xFF0000FF, "Nгo йs do comboio.");
    }
    else
    return 0;

    return 1;
}
linha modificada
pawn Код:
for(new i = 0; i < CONVOY_MAX_MEMBERS; i++)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)