Jump to content
  • 0

Problema GM - ore jucate aiurea. [E-LIKE GM]


Question

Posted

Problema intalnita (descriere): Deci, am un bug cand cineva isi face cont primeste 100 ore jucate+(nu toti). Mai este inca ceva, nu neaparat cand isi face cont, cand isi face cont sa zicem sa are 0 ore...dar cand da /q la fel are 100+ si inca una cand joaca mai mult tot asa...are 100+. Mai pe scurt, bug la GM e-like(bugged) cu orele, cine stie sa ma ajute sa-mi lase reply cu rezolvarea.
Ero(area / rile) / warning-(ul / urile): N-am ce erori, aici e vb de un bug pe server.
Liniile de cod / sursa / script-ul(obligatoriu): Nu stiu ce linii ar putea fii, dar as sti...
Imagini / Video (optional): Nu am, am dat WIPE la server.
Ati incercat sa rezolvati singur?: Am incercat sa caut prin GM si baza de date..dar nuj.

10 answers to this question

Recommended Posts

  • 0
Posted

Lasa OnPlayerDisconnect daca zici ca dupa ce dai /q ii da 100 de ore!

Man, nu le da la toti..la unii...doar uite ai onplayerdisconnect mai jos.

​[pawn]

public OnPlayerDisconnect(playerid, reason)
{
    #if defined DEBUG
        printf("[debug] OnPlayerDisconnect(%d, %d)", playerid, reason);
    #endif

    TextDrawDestroy(Status[playerid]);
    Distance[playerid] = 0;
    Alive[playerid] = 0;
    CheckDelay[playerid] = 0;
    SpawnTimes[playerid] = 0;

    ServerNews[playerid] = 0;
    playerVariables[playerid][pFarmerMoney] = 0;
    PlayerPaintballing[playerid] = 0;
    KillTimer(mowertimer[playerid]);
    SetPlayerName(playerid, playerVariables[playerid][pNormalName]);
    savePlayerData(playerid);
    if(GotHit[playerid] != 0)
    {
        new id = GoChase[playerid];
        GotHit[playerid] = 0;
        GoChase[playerid] = 999;
        GetChased[id] = 999;
        format(szMessage, sizeof(szMessage), "Your target has left the game. Use /contracts to see other targets.");
        SCM(id, COLOR_TEAL, szMessage);
    }
    if(GetChased[playerid] != 999)
    {
        GetChased[playerid] = 999;
    }
    
    
    new year, month, day, hour, minute, second;
    getdate(year, month, day);
    gettime(hour, minute, second);
    format(playerVariables[playerid][pLastLogin], 20, "%02d.%02d.%d %02d:%02d", day, month, year, hour, minute);
    new query[256];
    format(query, sizeof(query), "UPDATE playeraccounts SET playerLastLogin = '%s' WHERE playerID = '%d'", playerVariables[playerid][pLastLogin], playerVariables[playerid][pInternalID]);
    mysql_tquery(handle,query);
    if(playerVariables[playerid][pStatus] >= 1)
    {
        
        playerVariables[playerid][pStatus] = -1;
        foreach(Player, x)
        {
            if(playerVariables[x][pSpectating] == playerid)
            {

                TextDrawHideForPlayer(x, info[x]);
                TextDrawHideForPlayer(x, carspeed[x]);
                TextDrawHideForPlayer(x, carinfo[x]);
                TextDrawHideForPlayer(x, viata[x]);
                TextDrawHideForPlayer(x, wantedjail[x]);
                TogglePlayerSpectating(x, 0);
                SendClientMessage(x, COLOR_GREY, "The player you were spectating has disconnected.");
            }
        }
        if(TransportDuty[playerid] == 1)
        {
            TaxiDrivers -= 1;
        }
        if(TransportDuty[playerid] == 1)
        {
            TaxiDrivers -= 1;
        }
        if(TransportDuty[playerid] == 2)
        {
            BusDrivers -= 1;
        }
        foreach(Player, i)
        {
            if(TaxiAccepted < 999)
            {
                if(TaxiAccepted == playerid)
                {
                    TaxiAccepted = 999;
                    GameTextForPlayer(i, "~w~Taxi Caller~n~~r~Left the game", 5000, 1);
                    TaxiCallTime = 0;
                    DisablePlayerCheckpoint(i);
                }
            }
            if(MedicAccepted < 999)
            {
                if(MedicAccepted == playerid)
                {
                    MedicAccepted = 999;
                    GameTextForPlayer(i, "~w~Taxi Caller~n~~r~Left the game", 5000, 1);
                    MedicCallTime = 0;
                    DisablePlayerCheckpoint(i);
                }
            }
        }
        if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
        {
            if(IsPlayerConnected(TransportDriver[playerid]))
            {
                new string[64];
                TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
                TransportTime[TransportDriver[playerid]] = 0;
                TransportCost[TransportDriver[playerid]] = 0;
                format(string, sizeof(string), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
                GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
            }
        }
        if(playerVariables[playerid][pPhoneCall] != -1 && playerVariables[playerid][pPhoneCall] < MAX_PLAYERS)
        {

            SendClientMessage(playerVariables[playerid][pPhoneCall], COLOR_WHITE, "Your call has been terminated by the other party.");

            if(GetPlayerSpecialAction(playerVariables[playerid][pPhoneCall]) == SPECIAL_ACTION_USECELLPHONE)
            {
                SetPlayerSpecialAction(playerVariables[playerid][pPhoneCall], SPECIAL_ACTION_STOPUSECELLPHONE);
            }

            playerVariables[playerVariables[playerid][pPhoneCall]][pPhoneCall] = -1;
        }

        if(playerVariables[playerid][pAdminLevel] < 1)
        {
            switch(reason)
            {
                case 1: format(szMessage, sizeof(szMessage), "%s has left the server.", playerVariables[playerid][pNormalName]);
                case 2:    format(szMessage, sizeof(szMessage), "%s has been kicked or banned from the server.", playerVariables[playerid][pNormalName]);
                default: format(szMessage, sizeof(szMessage), "%s has timed out from the server.", playerVariables[playerid][pNormalName]);
            }
            nearByMessage(playerid, COLOR_GENANNOUNCE, szMessage);
        }

        if(playerVariables[playerid][pGroup] >= 1)
        {
            switch(reason)
            {
                case 0:
                {
                    format(szMessage, sizeof(szMessage), "%s from your group has disconnected (crash).", playerVariables[playerid][pNormalName]);
                }
                case 1:
                {
                    format(szMessage, sizeof(szMessage), "%s from your group has disconnected (quit).", playerVariables[playerid][pNormalName]);
                }
                case 2:
                {
                    format(szMessage, sizeof(szMessage), "%s from your group has disconnected (banned/kicked).", playerVariables[playerid][pNormalName]);
                }
            }
            SendToGroup(playerVariables[playerid][pGroup], COLOR_GENANNOUNCE, szMessage);
        }
          if(playerVariables[playerid][pCarModel1] >= 1)
        {
            DestroyVehicle(playerVariables[playerid][pCarID1]);
            Lock[playerVariables[playerid][pCarID1]] = 0;
            systemVariables[vehicleCounts][1]--;
            playerVariables[playerid][pCarID1] = -1;
            
        }
        if(playerVariables[playerid][pCarModel2] >= 1)
        {
            DestroyVehicle(playerVariables[playerid][pCarID2]);
            Lock[playerVariables[playerid][pCarID2]] = 0;
            systemVariables[vehicleCounts][1]--;
            playerVariables[playerid][pCarID2] = -1;
            
        }
        if(playerVariables[playerid][pCarModel3] >= 1)
        {
            DestroyVehicle(playerVariables[playerid][pCarID3]);
            Lock[playerVariables[playerid][pCarID3]] = 0;
            systemVariables[vehicleCounts][1]--;
            playerVariables[playerid][pCarID3] = -1;
            
        }
        if(playerVariables[playerid][pCarModel4] >= 1)
        {
            DestroyVehicle(playerVariables[playerid][pCarID4]);
            Lock[playerVariables[playerid][pCarID4]] = 0;
            systemVariables[vehicleCounts][1]--;
            playerVariables[playerid][pCarID4] = -1;
            
        }
        new mysqlquery[150];
        format(mysqlquery, 150, "UPDATE playeraccounts SET playerStatus = 0 WHERE playerID= '%d'", playerVariables[playerid][pInternalID]);
        mysql_tquery(handle,mysqlquery);
    }
    return 1;
}[/pawn]

  • 0
Posted (edited)

Ok, deci asta este un început de enumerație. Asta e doar o metoda pentru a reprezenta un grup mare de date, de inițializare a acestora. În principiu sunt folosite pentru a optimiza apelul anumitor variabile și pentru sortarea lor.

Am aruncat eu o privire și defapt se salvează în pPlayerHours;

Încearcă sa pui la OnPlayerDisconnect 
    playerVariables[playerid][pSeconds] = 0;

Edited by DCosmin
  • 0
Posted

am gasit in gm asta:

stock FetchLevelFromHours(const iHours) {
    switch(iHours) {
        case 0..24: return 1;
        case 25..48: return 2;
        case 49..72: return 3;
        case 73..100: return 4;
        case 101..175: return 5;
        case 176..200: return 6;
        case 201..208: return 8;
        case 209..336: return 9;
        case 337..480: return 10;
    }
    return 0;
}

 

am sters-o...oare asta era de vina?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.