[Ajuda] Ajuda vip
#1

Bom vim aqui pedir ajuda pois o meu /darvip eu do certinho mais tipo ele da este bug vou deixar o print abaixo.

pawn Код:
COMMAND:darvip(playerid, params[])
{
    // Setup local variables
    new OtherPlayer, Name[24], AdminName[24], Msg[128], OldLevel, NewVIPLevel;

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

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Check if the player's admin-level is at least 5
        if (APlayerData[playerid][PlayerLevel] >= 6)
        {
            if (sscanf(params, "ui", OtherPlayer, NewVIPLevel)) SendClientMessage(playerid, 0xFF0000AA, "[USE] \"/darvip <ID> <Nivel VIP>\"");
            else
            {
                // Check if that other player is online
                if (IsPlayerConnected(OtherPlayer))
                {
                    OldLevel = APlayerData[OtherPlayer][VIPLevel];
                    // Get the playername of the admin
                    GetPlayerName(playerid, AdminName, sizeof(AdminName));
                    // Also get the name of the player that has been promoted
                    GetPlayerName(OtherPlayer, Name, sizeof(Name));
                    // Store the level of the player
                    APlayerData[OtherPlayer][VIPLevel] = NewVIPLevel;
                    format(Msg, 128, "Voce ganhou %d por %s (%s)", VIPLevelName[APlayerData[playerid][VIPLevel]], AdminName, AdminLevelName[APlayerData[playerid][PlayerLevel]]);
                    SendClientMessage(OtherPlayer, 0x00FF00FF, Msg);
                    format(Msg, 128, "Voce deu %d ao jogador %s", VIPLevelName[APlayerData[playerid][VIPLevel]], Name);
                    SendClientMessage(playerid, 0x00FF00FF, Msg);
                    PlayerFile_Save(OtherPlayer);
                    if (OldLevel != NewVIPLevel)
                    {
                        // Check if the player has been promoted or demoted
                        format(Msg, 128, "[VIP] O jogador %s foi promovido a vip nivel %d pelo admin %s", Name, VIPLevelName[APlayerData[playerid][VIPLevel]], AdminName, AdminLevelName[APlayerData[playerid][PlayerLevel]]);
                        SendClientMessageToAll(0x00FF00FF, Msg);
                    }
                    else
                      SendClientMessage(playerid, 0xFF0000FF, "O nнvel do jogador nгo foi alterado");
                }
                else
                   SendClientMessage(playerid, 0xFF0000FF, "O jogador nao esta online");
            }
        }
        else
            return 0;
    }
    else
        return 0;

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

Print : imgur.com/MIaB69X
Reply
#2

Tenta agora

pawn Код:
COMMAND:darvip(playerid, params[])
{
    // Setup local variables
    new OtherPlayer, Name[24], AdminName[24], Msg[128], OldLevel, NewVIPLevel;

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

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Check if the player's admin-level is at least 5
        if (APlayerData[playerid][PlayerLevel] >= 6)
        {
            if (sscanf(params, "ud", OtherPlayer, NewVIPLevel)) SendClientMessage(playerid, 0xFF0000AA, "[USE] \"/darvip <ID> <Nivel VIP>\"");
            else
            {
                // Check if that other player is online
                if (IsPlayerConnected(OtherPlayer))
                {
                    OldLevel = APlayerData[OtherPlayer][VIPLevel];
                    // Get the playername of the admin
                    GetPlayerName(playerid, AdminName, sizeof(AdminName));
                    // Also get the name of the player that has been promoted
                    GetPlayerName(OtherPlayer, Name, sizeof(Name));
                    // Store the level of the player
                    APlayerData[OtherPlayer][VIPLevel] = NewVIPLevel;
                    format(Msg, 128, "Voce ganhou %d por %s (%s)", NewVIPLevel, AdminName, AdminLevelName[APlayerData[playerid][PlayerLevel]]);
                    SendClientMessage(OtherPlayer, 0x00FF00FF, Msg);
                    format(Msg, 128, "Voce deu %d ao jogador %s", NewVIPLevel, Name);
                    SendClientMessage(playerid, 0x00FF00FF, Msg);
                    PlayerFile_Save(OtherPlayer);
                    if (OldLevel != NewVIPLevel)
                    {
                        // Check if the player has been promoted or demoted
                        format(Msg, 128, "[VIP] O jogador %s foi promovido a vip nivel %d pelo admin %s", Name, NewVIPLevel, AdminName, AdminLevelName[APlayerData[playerid][PlayerLevel]]);
                        SendClientMessageToAll(0x00FF00FF, Msg);
                    }
                    else
                      SendClientMessage(playerid, 0xFF0000FF, "O nнvel do jogador nгo foi alterado");
                }
                else
                   SendClientMessage(playerid, 0xFF0000FF, "O jogador nao esta online");
            }
        }
        else
            return 0;
    }
    else
        return 0;

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

Foi mais surgiu mais um problema ! http://imgur.com/8Mxh7FI
Reply
#4

Mande o comando /vips sei lб como que olha
Reply
#5

pawn Код:
COMMAND:vips(playerid, params[])
{
    new VIPList[500], Name[24];

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Scan through all players
        for (new i; i < MAX_PLAYERS; i++)
        {
            // Check if this player is connected
            if (IsPlayerConnected(i))
            {
                // Get the name of the player
                GetPlayerName(i, Name, sizeof(Name));

                //Check if that player is an admin (using the PlayerLevel)
                if (APlayerData[i][VIPLevel] > 0)
                {
                    // Add all admin players to the list
                    format(VIPList, 500, "O %s й Jogador VIP. Nivel vip: %d\n", VIPList, Name, VIPLevelName[APlayerData[i][VIPLevel]]);
                    continue;
                }
            }
        }

        // Check if there were admin-names added to the list
        if (strlen(VIPList) > 0)
            ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Players Vips Online no LTB:", VIPList, "Ok", "Cancelar");
        else
            SendClientMessage(playerid, 0xFF0000FF, "Nenhum Player vip Online");
    }
    else
        return 0;

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

Veja se funciona assim

pawn Код:
COMMAND:vips(playerid, params[])
{
    new VIPList[500], Name[24];

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Scan through all players
        for (new i; i < MAX_PLAYERS; i++)
        {
            // Check if this player is connected
            if (IsPlayerConnected(i))
            {
                // Get the name of the player
                GetPlayerName(i, Name, sizeof(Name));

                //Check if that player is an admin (using the PlayerLevel)
                if (APlayerData[i][VIPLevel] > 0)
                {
                    // Add all admin players to the list
                    format(VIPList, 500, "O %s й Jogador VIP. Nivel vip: %d\n", VIPList, Name, APlayerData[i][VIPLevel]);
                    continue;
                }
            }
        }

        // Check if there were admin-names added to the list
        if (strlen(VIPList) > 0)
            ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Players Vips Online no LTB:", VIPList, "Ok", "Cancelar");
        else
            SendClientMessage(playerid, 0xFF0000FF, "Nenhum Player vip Online");
    }
    else
        return 0;

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

Ainda nгo estб dando certo,
Reply
#8

Tenta agora, tinha deixado uns negocio em cima

pawn Код:
COMMAND:vips(playerid, params[])
{
    new VIPList[500], Name[24];

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Scan through all players
        for (new i; i < MAX_PLAYERS; i++)
        {
            // Check if this player is connected
            if (IsPlayerConnected(i))
            {
                // Get the name of the player
                GetPlayerName(i, Name, sizeof(Name));

                //Check if that player is an admin (using the PlayerLevel)
                if (APlayerData[i][VIPLevel] > 0)
                {
                    // Add all admin players to the list
                    format(VIPList, 500, "O %s й Jogador VIP. Nivel vip: %d\n", VIPList, Name, APlayerData[i][VIPLevel]);
                    continue;
                }
            }
        }

        // Check if there were admin-names added to the list
        if (strlen(VIPList) > 0)
            ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Players Vips Online no LTB:", VIPList, "Ok", "Cancelar");
        else
            SendClientMessage(playerid, 0xFF0000FF, "Nenhum Player vip Online");
    }
    else
        return 0;

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

Bom a falta de atenзгo foi fatal neste caso.
VIPLevelName nгo e uma variavel de numeros e sim para amarzenamento de celulas.

Tente assim:

PHP код:
COMMAND:darvip(playeridparams[])
{
    new 
OtherPlayerName[24], AdminName[24], Msg[128], OldLevelNewVIPLevel;
    
SendAdminText(playerid"/darvip"params);
    if (
APlayerData[playerid][LoggedIn] == true)
    {
        if (
APlayerData[playerid][PlayerLevel] >= 6)
        {
            if (
sscanf(params"ud"OtherPlayerNewVIPLevel)) SendClientMessage(playerid0xFF0000AA"[USE] \"/darvip <ID> <Nivel VIP>\"");
            else
            {
                if (
IsPlayerConnected(OtherPlayer))
                {
                    
OldLevel APlayerData[OtherPlayer][VIPLevel];
                    
GetPlayerName(playeridAdminNamesizeof(AdminName));
                    
GetPlayerName(OtherPlayerNamesizeof(Name));
                    
APlayerData[OtherPlayer][VIPLevel] = NewVIPLevel;
                    
format(Msg128"Voce ganhou %d por %s (%s)"VIPLevelName[APlayerData[playerid][VIPLevel]], AdminNameAdminLevelName[APlayerData[playerid][PlayerLevel]]);
                    
SendClientMessage(OtherPlayer0x00FF00FFMsg);
                    
format(Msg128"Voce deu %d ao jogador %s"VIPLevelName[APlayerData[playerid][VIPLevel]], Name);
                    
SendClientMessage(playerid0x00FF00FFMsg);
                    
PlayerFile_Save(OtherPlayer);
                    if (
OldLevel != NewVIPLevel)
                    {
                        
format(Msg128"[VIP] O jogador %s foi promovido a vip %s pelo admin %s %s."NameVIPLevelName[APlayerData[playerid][VIPLevel]], AdminNameAdminLevelName[APlayerData[playerid][PlayerLevel]]);
                        
SendClientMessageToAll(0x00FF00FFMsg);
                    }
                    else 
SendClientMessage(playerid0xFF0000FF"O nнvel do jogador nгo foi alterado");
                }
                else 
SendClientMessage(playerid0xFF0000FF"O jogador nao esta online");
            }
        }
    }
    return 
1;
}
COMMAND:vips(playeridparams[])
{
    new 
VIPList[500], Name[24];
    if (
APlayerData[playerid][LoggedIn] == true)
    {
        for (new 
iMAX_PLAYERSi++)
        {
            if (
IsPlayerConnected(i))
            {
                
GetPlayerName(iNamesizeof(Name));
                if (
APlayerData[i][VIPLevel] > 0)
                {
                    
format(VIPList500"%sO %s й Jogador VIP. Nivel vip: %s\n"VIPListNameVIPLevelName[APlayerData[i][VIPLevel]]);
                    continue;
                }
            }
        }
        if (
strlen(VIPList) > 0)
            
ShowPlayerDialog(playeridDialogNoResponseDIALOG_STYLE_LIST"Players Vips Online no LTB:"VIPList"Ok""Cancelar");
        else
            
SendClientMessage(playerid0xFF0000FF"Nenhum Player vip Online");
    }
    return 
1;

Reply
#10

Ei como eu faзo pra os vips serem salvos ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)