[Ajuda] sistema vip
#1

Vim aqui pedir ajuda,o seguinte problema й que eu do vip no jogo e dou /vips normal ai aparece,depois eu vou na scriptfiles e olho minha conta ta normal o nivel do vip sу que quando eu entro dnv no sv ele nгo aparece meu nick no /vips quem puder me ajudar.

pawn Код:
COMMAND:vips(playerid, params[])
{
    new VIPList[500], Name[24];
    if (APlayerData[playerid][LoggedIn] == true)
    {
        for (new i; i < MAX_PLAYERS; i++)
        {
            if (IsPlayerConnected(i))
            {
                GetPlayerName(i, Name, sizeof(Name));
                if (APlayerData[i][VIPLevel] > 0)
                {
                    format(VIPList, 500, "%sO %s й Jogador VIP. Nivel vip: %s\n", VIPList, Name, VIPLevelName[APlayerData[i][VIPLevel]]);
                    continue;
                }
            }
        }
        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");
    }
    return 1;
}
Reply
#2

O problema nгo estб aн, segundo vocк: o vip estб salvando mбs nгo estб carregando. Verifique se vocк estб realmente carregando a variбvel de VIP e se o nome salvo no .ini estб correto.
Reply
#3

vou tentar ajudar, mais estou no cel, manda o OnPlayerConnect e OnPlayerDisconnect
Reply
#4

pawn Код:
// Always allow NPC's to login without password or account
    if (IsPlayerNPC(playerid))
        return 1;

    // Setup local variables
    new Name[MAX_PLAYER_NAME], NewPlayerMsg[128], HouseID;


    // Setup a PVar to allow cross-script money-transfers (only from filterscript to this mainscript) and scorepoints
    SetPVarInt(playerid, "PVarMoney", 0);
    SetPVarInt(playerid, "PVarScore", 0);

    // Get the playername
    GetPlayerName(playerid, Name, sizeof(Name));
    // Also store this name for the player
    GetPlayerName(playerid, APlayerData[playerid][PlayerName], 24);
    //format(NewPlayerMsg, 256, TXT_PlayerJoinedServer, Name, playerid, IP);
    //SendClientMessageToAll(0xFFFFFFFF, NewPlayerMsg);

    // Try to load the player's datafile ("PlayerFile_Load" returns "1" is the file has been read, "0" when the file cannot be read)
    if (PlayerFile_Load(playerid) == 1)
    {
        // Check if the player is still banned
        if (APlayerData[playerid][BanTime] < gettime()) // Player ban-time is passed
            ShowPlayerDialog(playerid, DialogLogin, DIALOG_STYLE_PASSWORD, TXT_DialogLoginTitle, TXT_DialogLoginMsg, TXT_DialogLoginButton1, TXT_DialogButtonCancel);
        else // Player is still banned
        {
            ShowRemainingBanTime(playerid); // Show the remaining ban-time to the player is days, hours, minutes, seconds
            Kick(playerid); // Kick the player
        }
    }
    else
        ShowPlayerDialog(playerid, DialogRegister, DIALOG_STYLE_PASSWORD, TXT_DialogRegisterTitle, TXT_DialogRegisterMsg, TXT_DialogRegisterButton1, TXT_DialogButtonCancel);

    // The houses have been loaded but not the cars, so load all vehicles assigned to the player's houses
    for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
    {
        // Get the HouseID from this slot
        HouseID = APlayerData[playerid][Houses][HouseSlot];
        // Check if there is a house in this slot
        if (HouseID != 0)
            HouseFile_Load(HouseID, true); // Load the cars of the house
    }

    // Speedometer setup
    Speedometer_Setup(playerid);

    // MissionText TextDraw setup
    APlayerData[playerid][MissionText] = TextDrawCreate(310.000000, 433.000000, " "); // Setup the missiontext at the bottom of the screen
    TextDrawBackgroundColor(APlayerData[playerid][MissionText], 255);
    TextDrawAlignment(APlayerData[playerid][MissionText], 2);
    TextDrawFont(APlayerData[playerid][MissionText], 3);
    TextDrawLetterSize(APlayerData[playerid][MissionText], 0.200000, 0.999999);
    TextDrawColor(APlayerData[playerid][MissionText], -1);
    TextDrawSetOutline(APlayerData[playerid][MissionText], 0);
    TextDrawSetProportional(APlayerData[playerid][MissionText], 1);
    TextDrawSetShadow(APlayerData[playerid][MissionText], 1);
    TextDrawUseBox(APlayerData[playerid][MissionText], 1);
    TextDrawBoxColor(APlayerData[playerid][MissionText], 0x00000076);
    if(APlayerData[playerid][PlayerLevel] > 1)
    {
    new DName[MAX_PLAYER_NAME], Don[50];
    GetPlayerName(playerid,DName,sizeof(DName));
    format(Don,sizeof(Don),"~y~%s ~r~ON",DName);
    SendClientMessage(playerid, Cinza, "-  {a9c4e4}Administrador: {FF0000}Sim");
    }else{
    SendClientMessage(playerid, Cinza, "-  {a9c4e4}Administrador: {FF0000}Nгo");
    }
    // Display a message if the player hasn't accepted the rules yet
    if (APlayerData[playerid][RulesRead] == false)
    SendClientMessage(playerid, 0xFFFFFFFF, "{D7D7D7}Confira as Regras do Life Of Trucker's Brasil em {FFFFFF}/regras{D7D7D7} e Aceite-as!");
    return 1;
}

pawn Код:
// This callback gets called when a player disconnects from the server
public OnPlayerDisconnect(playerid, reason)
{
    TextDrawShowForPlayer(playerid, ImagemEntrada);

    // Always allow NPC's to logout without password or account
    if (IsPlayerNPC(playerid))
        return 1;

    // Setup local variables
    new Name[24], Msg[128], HouseID;

    // Get the playername
    GetPlayerName(playerid, Name, sizeof(Name));

    // Stop spectate mode for all players who are spectating this player
    for (new i; i < MAX_PLAYERS; i++)
        if (IsPlayerConnected(i)) // Check if the player is connected
            if (GetPlayerState(i) == PLAYER_STATE_SPECTATING) // Check if this player is spectating somebody
                if (APlayerData[i][SpectateID] == playerid) // Check if this player is spectating me
                {
                    TogglePlayerSpectating(i, 0); // Turn off spectate-mode
                    APlayerData[i][SpectateID] = INVALID_PLAYER_ID;
                    APlayerData[i][SpectateType] = ADMIN_SPEC_TYPE_NONE;
                    SendClientMessage(i, 0xFFFFFFFF, "{808080}O Jogador nгo Estб Online. Fechando o Modo Espiar!");
                }

    if(APlayerData[playerid][PlayerLevel] <= 0){
        format(Msg, 256, TXT_PlayerLeftServer, Name, playerid);
        SendClientMessageToAll(0xFFFFFFFF, Msg);
    }else{
        format(Msg, 256, TXT_AdminLeftServer, Name, playerid);
        SendClientMessageToAll(0xFFFFFFFF, Msg);
    }

    // If the player entered a proper password (the player has an account)
    if (strlen(APlayerData[playerid][PlayerPassword]) != 0)
    {
        // Save the player data and his houses
        PlayerFile_Save(playerid);
    }

    // Stop any job that may have started (this also clears all mission data)
    switch (APlayerData[playerid][PlayerClass])
    {
        case ClassTruckDriver: Trucker_EndJob(playerid); // Stop any trucker job
        case ClassBusDriver: BusDriver_EndJob(playerid); // Stop any busdriver job
        case ClassPilot: Pilot_EndJob(playerid); // Stop any pilot job
        case ClassPolice: Police_EndJob(playerid); // Stop any police job
        case ClassMafia: Mafia_EndJob(playerid); // Stop any mafia job
        case ClassAssistance: Assistance_EndJob(playerid);
        case ClassRoadWorker: Roadworker_EndJob(playerid);
    }

    // If the player is part of a convoy, kick him from it
    Convoy_Leave(playerid);

    // Unload all the player's house-vehicles to make room for other player's vehicles
    for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
    {
        // Get the HouseID from this slot
        HouseID = APlayerData[playerid][Houses][HouseSlot];
        // Check if there is a house in this slot
        if (HouseID != 0)
        {
            // Unload the cars of the house
            House_RemoveVehicles(HouseID);
            // Set the house so it cannot be entered by anyone (close the house)
            AHouseData[HouseID][HouseOpened] = false;
        }
    }

    // Clear the data in the APlayerData array to make sure the next player with the same id doesn't hold wrong data
    APlayerData[playerid][SpectateID] = -1;
    APlayerData[playerid][SpectateVehicle] = -1;
    APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_NONE;
    APlayerData[playerid][LoggedIn] = false;
    APlayerData[playerid][AssistanceNeeded] = false;
    APlayerData[playerid][PlayerPassword] = 0;
    APlayerData[playerid][PlayerLevel] = 0;
    APlayerData[playerid][VIPLevel] = 0;
    APlayerData[playerid][PlayerJailed] = 0;
    APlayerData[playerid][PlayerFrozen] = 0; // Clearing this variable automatically kills the frozentimer
    APlayerData[playerid][Bans] = 0;
    APlayerData[playerid][BanTime] = 0;
    APlayerData[playerid][Muted] = false;
    APlayerData[playerid][RulesRead] = false;
    APlayerData[playerid][AutoReportTime] = 0;
    APlayerData[playerid][TruckerLicense] = 0;
    APlayerData[playerid][BusLicense] = 0;
    APlayerData[playerid][WeaponLicense] = 0;
    APlayerData[playerid][PlayerClass] = 0;
    APlayerData[playerid][Warnings] = 0;
    APlayerData[playerid][PlayerMoney] = 0;
    APlayerData[playerid][PlayerScore] = 0;
    for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
        APlayerData[playerid][Houses][HouseSlot] = 0;
    for (new BusSlot; BusSlot < MAX_BUSINESSPERPLAYER; BusSlot++)
        APlayerData[playerid][Business][BusSlot] = 0;
    APlayerData[playerid][CurrentHouse] = 0;

    // Clear bank account info
    APlayerData[playerid][BankPassword] = 0;
    APlayerData[playerid][BankLoggedIn] = false;
    APlayerData[playerid][BankMoney] = 0;

    // Clear stats
    APlayerData[playerid][StatsTruckerJobs] = 0;
    APlayerData[playerid][StatsConvoyJobs] = 0;
    APlayerData[playerid][StatsBusDriverJobs] = 0;
    APlayerData[playerid][StatsPilotJobs] = 0;
    APlayerData[playerid][StatsMafiaJobs] = 0;
    APlayerData[playerid][StatsMafiaStolen] = 0;
    APlayerData[playerid][StatsPoliceFined] = 0;
    APlayerData[playerid][StatsPoliceJailed] = 0;
    APlayerData[playerid][StatsCourierJobs] = 0;
    APlayerData[playerid][StatsRoadworkerJobs] = 0;
    APlayerData[playerid][StatsAssistance] = 0;
    APlayerData[playerid][StatsMetersDriven] = 0.0;

    // Clear police warnings
    APlayerData[playerid][PoliceCanJailMe] = false;
    APlayerData[playerid][PoliceWarnedMe] = false;
    APlayerData[playerid][Value_PoliceCanJailMe] = 0;

    // Make sure the jailtimer has been destroyed
    KillTimer(APlayerData[playerid][PlayerJailedTimer]);
    KillTimer(APlayerData[playerid][Timer_PoliceCanJailMe]);

    // Destroy the speedometer TextDraw for this player and the timer, also set the speed to 0
    Speedometer_Cleanup(playerid);

    // Also destroy the missiontext TextDraw for this player
    TextDrawDestroy(APlayerData[playerid][MissionText]);

    // Destroy a rented vehicle is the player had any
    if (APlayerData[playerid][RentedVehicleID] != 0)
    {
        // Clear the data for the already rented vehicle
        AVehicleData[APlayerData[playerid][RentedVehicleID]][Model] = 0;
        AVehicleData[APlayerData[playerid][RentedVehicleID]][Fuel] = 0;
        AVehicleData[APlayerData[playerid][RentedVehicleID]][Owned] = false;
        AVehicleData[APlayerData[playerid][RentedVehicleID]][Owner] = 0;
        AVehicleData[APlayerData[playerid][RentedVehicleID]][PaintJob] = 0;
        for (new j; j < 14; j++)
        {
            AVehicleData[APlayerData[playerid][RentedVehicleID]][Components][j] = 0;
        }
        // Destroy the vehicle
        DestroyVehicle(APlayerData[playerid][RentedVehicleID]);
        // Clear the RentedVehicleID
        APlayerData[playerid][RentedVehicleID] = 0;
    }

    return 1;
}
Reply
#5

Alguem ?
Reply
#6

Pode ser que esta carregando de uma forma errada !
Poste as Callback de carregamento da conta!
Reply
#7

Ve na include PPC_FileOperations se tem lб alguma define para salvar o vip
Caso nгo tenho add lб isso! estб por ordem.


PlayerFile_Create

format(LineForFile, 100, "Vip %i\r\n", 0); // Construct the line: "Vip <playerlevel>"
fwrite(PFile, LineForFile); // And save it to the file

PlayerFile_Load

if (strcmp(ParameterName, "Vip", false) == 0) // If the parametername is correct ("Level")
APlayerData[playerid][VIPLevel] = strval(ParameterValue); // Store the playerlevel

PlayerFile_Save

format(LineForFile, 100, "Vip %i\r\n", APlayerData[playerid][PlayerVIP]); // Construct the line: "Level <playerlevel>"
fwrite(PFile, LineForFile); // And save it to the file
Reply
#8

Quote:
Originally Posted by JoaoMonteiro452
Посмотреть сообщение
Ve na include PPC_FileOperations se tem lб alguma define para salvar o vip
Caso nгo tenho add lб isso! estб por ordem.


PlayerFile_Create

format(LineForFile, 100, "Vip %i\r\n", 0); // Construct the line: "Vip <playerlevel>"
fwrite(PFile, LineForFile); // And save it to the file

PlayerFile_Load

if (strcmp(ParameterName, "Vip", false) == 0) // If the parametername is correct ("Level")
APlayerData[playerid][VIPLevel] = strval(ParameterValue); // Store the playerlevel

PlayerFile_Save

format(LineForFile, 100, "Vip %i\r\n", APlayerData[playerid][PlayerVIP]); // Construct the line: "Level <playerlevel>"
fwrite(PFile, LineForFile); // And save it to the file
pawn Код:
//Nossa..
APlayerData[playerid][VIPLevel] = strval(ParameterValue);

/* ********************************* */
format(LineForFile, 100, "Vip %i\r\n", APlayerData[playerid][PlayerVIP]); // Construct the line: "Level <playerlevel>"

//Nгo deveria ser uma variavel sу?
//Legal tu postar os // em inglкs ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)