Jump to content
  • 0

Problemă afişare


Marcel2

Question

Dacă variabilia este schimbată in timp de serverul este pornit, aceasta se modifică in baza de date, dar pe joc nu se afişează corect.

VIdeo cu problema: LINK

Functia:

Spoiler



stock ShowPlayerVehicle(playerid) {
    new szTitle[180], szDialog[1300], szDialog2[1300], vstatus[1024];
    LoadPlayerCars(playerid);
    if(GetVehicles(playerid) == 0) return SendClientMessage(playerid, COLOR_LGREEN, "Eroare: Nu ai un vehicul personal!");
    format(szTitle, sizeof(szTitle), "Vehicles (%d/%d)", GetVehicles(playerid), TotalSlots(playerid));
    strcat(szDialog2, "Model\t\tStatus\t\tKM\t\tVIP\n");        
    for(new i = 0; i < 20; i++) {
        new car =  PlayerInfo[playerid][pCarKey][i];
        if(car != 0) {
            if(IsVehicleOccupied(CarInfo[car][Spawned])) format(vstatus, sizeof(vstatus), "%s\t\t{FFFF00}(Occupied){FFFFFF}\t\t%.2f\t%d", aVehicleNames[CarInfo[car][cModel]-400], CarInfo[car][KM], CarInfo[car][cVIPcar]);
            else if(CarInfo[car][Spawned] > 0) format(vstatus, sizeof(vstatus), "%s\t\t{26B309}(Spawned){FFFFFF}\t\t%.2f\t%d", aVehicleNames[CarInfo[car][cModel]-400], CarInfo[car][KM], CarInfo[car][cVIPcar]);
            else format(vstatus, sizeof(vstatus), "%s\t\t{FF0000}(Despawned){FFFFFF}\t\t%.2f\t%d", aVehicleNames[CarInfo[car][cModel]-400], CarInfo[car][KM], CarInfo[car][cVIPcar]);
            format(szDialog, sizeof(szDialog), "%s\n", vstatus);
            strcat(szDialog2, szDialog);
        }
        else strcat(szDialog2, "{FFD857}<slot liber>\n"), sVehicle[i][playerid] = 0;
    }
    ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_TABLIST_HEADERS, szTitle, szDialog2, "Ok", "Exit");
    return 1;
}


 

 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
Acum 45 minute, [El.Capo] a spus:

arata dialogul 


DIALOG_GARAGE

si 


DIALOG_GARAGE+1

        Pentru al 2-lea dialog ţi-am dat doar partea de inceput şi cazul pentru VIP, pentru că e un dialog destul de stufos.

Spoiler

        case DIALOG_GARAGE: {
            if(!response) return 1;
            new idd;
            if(PlayerInfo[playerid][pCarKey][listitem] == 0) return 1;
            else idd = PlayerInfo[playerid][pCarKey][listitem];    
            sVehicle[5][playerid] = idd;    
            SetPVarInt(playerid, "VehicleSlot", listitem);                
            if(CarInfo[idd][Spawned] != 0) strcat(string,      "Vehicle Info\nFind Vehicle\nTow Vehicle (/park)\nTow Vehicle (last known location)\nDespawn\nDebug\nSell Vehicle\nBuy Insurance\nUpgrade to VIP Vehicle - {FFFF00}1xTiceket VIP{FFFFFF}\n{FF0000}Remove tuning");
            else if(CarInfo[idd][Spawned] == 0) strcat(string, "Vehicle Info\nFind Vehicle\nTow Vehicle (/park)\nTow Vehicle (last known location)\nSpawn vehicle\nDebug\nSell Vehicle\nBuy Insurance\nUpgrade to VIP Vehicle - {FFFF00}1xTiceket VIP{FFFFFF}\n{FF0000}Remove tuning");
            if(CarInfo[idd][Confiscated] == 1) strcat(string, "\n{FFFFFF}Pay fine to TTC");
            ShowPlayerDialog(playerid, DIALOG_GARAGE1, DIALOG_STYLE_LIST, "Options", string, "Ok", "Back");
        }

 

Spoiler

        case DIALOG_GARAGE1: {
            if(!response) return ShowPlayerVehicle(playerid);
            new vsid = sVehicle[5][playerid];
            switch(listitem) {

                case 8: {
                    if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
                    if(valid_vip_vehicle(CarInfo[vsid][cModel]) == 0) return SCM(playerid, COLOR_GREY, "Acest vehicul nu poate fi upgradat!");
                    if(strlen(CarInfo[vsid][cText]) > 3) return SCM(playerid, -1, "Acest vehicul este deja unul VIP!");
                    if(PlayerInfo[playerid][pVIPTicket] < 1) return SCM(playerid, -1, "Nu ai un Ticket VIP.");
                    SetPVarInt(playerid, "VehicleID", vsid);
                    ShowPlayerDialog(playerid, DIALOG_UPGRADEVIP, DIALOG_STYLE_MSGBOX, "Upgrade to VIP Vehicle", "Esti sigur ca vrei sa faci acest lucru?\nVei pierde 1xTicket VIP.", "Da", "Nu");
                }

 

Presupun că o să fie nevoie şi de acest dialog:

        

Spoiler

        case DIALOG_UPGRADEVIP: {
            if(!response) return 1;
            new idd = GetPVarInt(playerid, "VehicleID");
            if(CarInfo[idd][Spawned] == 0) return SendClientMessage(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
            if(valid_vip_vehicle(CarInfo[idd][cModel]) == 0) return SCM(playerid, COLOR_GREY, "Acest vehicul nu poate fi upgradat!");
            if(strlen(CarInfo[idd][cText]) > 3) return SCM(playerid, -1, "Acest vehicul este deja unul VIP!");
            if(PlayerInfo[playerid][pPremiumPoints] < 1008) return SCM(playerid, -1, "Nu ai destule puncte premium.");        
            if(IsABike2(CarInfo[idd][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti upgrada acest vehicul!");
            PlayerInfo[playerid][pVIPTicket] -= 1;
            Update(playerid, pVIPTicketx);
            SCM(playerid, COLOR_YELLOW, "* Felicitari! Ti-ai upgradat cu succes vehiculul la unul VIP.");
            format(string, sizeof(string), "%s si-a upgradat vehiculul %s[id: %d] la unul VIP pentru 1xTicket VIP.", GetName(playerid), aVehicleNames[CarInfo[idd][cModel]-400], idd);
            InsertLog(playerid, string, LOG_SHOP);                
            format(string, sizeof(string), "UPDATE `cars` SET `Text`='%s' WHERE `ID`='%d'", GetName(playerid), idd);
            mysql_query(SQL, string);
            format(CarInfo[idd][cText], 32, GetName(playerid));
            attach_vip_text(idd);
            format(query, sizeof(query), "UPDATE `cars` SET `VIPcar`='1' WHERE `ID`='%d'", idd);
            mysql_query(SQL, query);
        }

 

 

Edited by Moise05
Reaşezare
Link to comment
Share on other sites

  • 0
Acum 10 minute, Moise05 a spus:

        Pentru al 2-lea dialog ţi-am dat doar partea de inceput şi cazul pentru VIP, pentru că e un dialog destul de stufos.

  Ascunde conținuturi


        case DIALOG_GARAGE: {
            if(!response) return 1;
            new idd;
            if(PlayerInfo[playerid][pCarKey][listitem] == 0) return 1;
            else idd = PlayerInfo[playerid][pCarKey][listitem];    
            sVehicle[5][playerid] = idd;    
            SetPVarInt(playerid, "VehicleSlot", listitem);                
            if(CarInfo[idd][Spawned] != 0) strcat(string,      "Vehicle Info\nFind Vehicle\nTow Vehicle (/park)\nTow Vehicle (last known location)\nDespawn\nDebug\nSell Vehicle\nBuy Insurance\nUpgrade to VIP Vehicle - {FFFF00}1xTiceket VIP{FFFFFF}\n{FF0000}Remove tuning");
            else if(CarInfo[idd][Spawned] == 0) strcat(string, "Vehicle Info\nFind Vehicle\nTow Vehicle (/park)\nTow Vehicle (last known location)\nSpawn vehicle\nDebug\nSell Vehicle\nBuy Insurance\nUpgrade to VIP Vehicle - {FFFF00}1xTiceket VIP{FFFFFF}\n{FF0000}Remove tuning");
            if(CarInfo[idd][Confiscated] == 1) strcat(string, "\n{FFFFFF}Pay fine to TTC");
            ShowPlayerDialog(playerid, DIALOG_GARAGE1, DIALOG_STYLE_LIST, "Options", string, "Ok", "Back");
        }

 

  Ascunde conținuturi


        case DIALOG_GARAGE1: {
            if(!response) return ShowPlayerVehicle(playerid);
            new vsid = sVehicle[5][playerid];
            switch(listitem) {

                case 8: {
                    if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
                    if(valid_vip_vehicle(CarInfo[vsid][cModel]) == 0) return SCM(playerid, COLOR_GREY, "Acest vehicul nu poate fi upgradat!");
                    if(strlen(CarInfo[vsid][cText]) > 3) return SCM(playerid, -1, "Acest vehicul este deja unul VIP!");
                    if(PlayerInfo[playerid][pVIPTicket] < 1) return SCM(playerid, -1, "Nu ai un Ticket VIP.");
                    SetPVarInt(playerid, "VehicleID", vsid);
                    ShowPlayerDialog(playerid, DIALOG_UPGRADEVIP, DIALOG_STYLE_MSGBOX, "Upgrade to VIP Vehicle", "Esti sigur ca vrei sa faci acest lucru?\nVei pierde 1xTicket VIP.", "Da", "Nu");
                }

 

Presupun că o să fie nevoie şi de acest dialog:

        

  Ascunde conținuturi


        case DIALOG_UPGRADEVIP: {
            if(!response) return 1;
            new idd = GetPVarInt(playerid, "VehicleID");
            if(CarInfo[idd][Spawned] == 0) return SendClientMessage(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
            if(valid_vip_vehicle(CarInfo[idd][cModel]) == 0) return SCM(playerid, COLOR_GREY, "Acest vehicul nu poate fi upgradat!");
            if(strlen(CarInfo[idd][cText]) > 3) return SCM(playerid, -1, "Acest vehicul este deja unul VIP!");
            if(PlayerInfo[playerid][pPremiumPoints] < 1008) return SCM(playerid, -1, "Nu ai destule puncte premium.");        
            if(IsABike2(CarInfo[idd][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti upgrada acest vehicul!");
            PlayerInfo[playerid][pVIPTicket] -= 1;
            Update(playerid, pVIPTicketx);
            SCM(playerid, COLOR_YELLOW, "* Felicitari! Ti-ai upgradat cu succes vehiculul la unul VIP.");
            format(string, sizeof(string), "%s si-a upgradat vehiculul %s[id: %d] la unul VIP pentru 1xTicket VIP.", GetName(playerid), aVehicleNames[CarInfo[idd][cModel]-400], idd);
            InsertLog(playerid, string, LOG_SHOP);                
            format(string, sizeof(string), "UPDATE `cars` SET `Text`='%s' WHERE `ID`='%d'", GetName(playerid), idd);
            mysql_query(SQL, string);
            format(CarInfo[idd][cText], 32, GetName(playerid));
            attach_vip_text(idd);
            format(query, sizeof(query), "UPDATE `cars` SET `VIPcar`='1' WHERE `ID`='%d'", idd);
            mysql_query(SQL, query);
        }

 

 

Inlocuieste DIALOG_UPGRADEVIP cu asta

        case DIALOG_UPGRADEVIP: {
            if(!response) return 1;
            new idd = GetPVarInt(playerid, "VehicleID");
            if(CarInfo[idd][Spawned] == 0) return SendClientMessage(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
            if(valid_vip_vehicle(CarInfo[idd][cModel]) == 0) return SCM(playerid, COLOR_GREY, "Acest vehicul nu poate fi upgradat!");
            if(strlen(CarInfo[idd][cText]) > 3) return SCM(playerid, -1, "Acest vehicul este deja unul VIP!");
            if(PlayerInfo[playerid][pPremiumPoints] < 1008) return SCM(playerid, -1, "Nu ai destule puncte premium.");        
            if(IsABike2(CarInfo[idd][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti upgrada acest vehicul!");
            PlayerInfo[playerid][pVIPTicket] -= 1;
            Update(playerid, pVIPTicketx);
            SCM(playerid, COLOR_YELLOW, "* Felicitari! Ti-ai upgradat cu succes vehiculul la unul VIP.");
            format(string, sizeof(string), "%s si-a upgradat vehiculul %s[id: %d] la unul VIP pentru 1xTicket VIP.", GetName(playerid), aVehicleNames[CarInfo[idd][cModel]-400], idd);
            InsertLog(playerid, string, LOG_SHOP);                
            format(string, sizeof(string), "UPDATE `cars` SET `Text`='%s' WHERE `ID`='%d'", GetName(playerid), idd);
            mysql_query(SQL, string);
            format(CarInfo[idd][cText], 32, GetName(playerid));
            attach_vip_text(idd);
            CarInfo[idd][cVIPcar] = 1;
            format(query, sizeof(query), "UPDATE `cars` SET `VIPcar`='1' WHERE `ID`='%d'", idd);
            mysql_query(SQL, query);
        }

  • Upvote 1
Link to comment
Share on other sites

  • 0
Acum 9 minute, [El.Capo] a spus:

Inlocuieste DIALOG_UPGRADEVIP cu asta

        case DIALOG_UPGRADEVIP: {
            if(!response) return 1;
            new idd = GetPVarInt(playerid, "VehicleID");
            if(CarInfo[idd][Spawned] == 0) return SendClientMessage(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
            if(valid_vip_vehicle(CarInfo[idd][cModel]) == 0) return SCM(playerid, COLOR_GREY, "Acest vehicul nu poate fi upgradat!");
            if(strlen(CarInfo[idd][cText]) > 3) return SCM(playerid, -1, "Acest vehicul este deja unul VIP!");
            if(PlayerInfo[playerid][pPremiumPoints] < 1008) return SCM(playerid, -1, "Nu ai destule puncte premium.");        
            if(IsABike2(CarInfo[idd][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti upgrada acest vehicul!");
            PlayerInfo[playerid][pVIPTicket] -= 1;
            Update(playerid, pVIPTicketx);
            SCM(playerid, COLOR_YELLOW, "* Felicitari! Ti-ai upgradat cu succes vehiculul la unul VIP.");
            format(string, sizeof(string), "%s si-a upgradat vehiculul %s[id: %d] la unul VIP pentru 1xTicket VIP.", GetName(playerid), aVehicleNames[CarInfo[idd][cModel]-400], idd);
            InsertLog(playerid, string, LOG_SHOP);                
            format(string, sizeof(string), "UPDATE `cars` SET `Text`='%s' WHERE `ID`='%d'", GetName(playerid), idd);
            mysql_query(SQL, string);
            format(CarInfo[idd][cText], 32, GetName(playerid));
            attach_vip_text(idd);
            CarInfo[idd][cVIPcar] = 1;
            format(query, sizeof(query), "UPDATE `cars` SET `VIPcar`='1' WHERE `ID`='%d'", idd);
            mysql_query(SQL, query);
        }

Da, asta era. Mersi, chiar nu m-am gândit să-i declar valoare 1, inate să o urc şi in baza de date. :))

Am crezut că ar trebuii să o citească automat, odată ce e scrisă, the more you know. Thx.

Cer T/C.

Link to comment
Share on other sites

  • 0
Acum 2 minute, Moise05 a spus:

Da, asta era. Mersi, chiar nu m-am gândit să-i declar valoare 1, inate să o urc şi in baza de date. :))

Am crezut că ar trebuii să o citească automat, odată ce e scrisă, the more you know. Thx.

Cer T/C.

Un up mar ajuta ❤️ 

 

Edt: nu mai e nev ca deja ai dat :D

Edited by [El.Capo]
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.