Jump to content
  • 0

[Help]Cand esti prost,cere ajutorul la altcineva mai destept :))


Gasi244

Question

Helloo, all !

Problema mea este urmatoarea , mi-am dorit sa fac un system de ''change-name'' pentru a le oferi libertatea tuturor jucatorilor sa-si aleaga alt nume daca s-au plictisit de actualul nickname, dar am intampinat o mica problema. Nu mi se transfera toate masinile , se transfera doar o masina sau doua  din 5 sau 6. Depinde cate masini am. 

O sa va las mai jos o parte din cod si ar trebui sa fie suficient ca sa va faceti o idee. 

Multumesc anticipat tuturor celor care vor sa ma ajute ! :D 

Cod:

if(strcmp(Vehicles[playerid][vehOwner], PlayerName(playerid)))
   {
      format(DSV, 512, "UPDATE `personalcars` SET `vehOwner` = '%s' WHERE `ID` = '%d'", name, Vehicles[seterid][vehID]);
       mysql_tquery(DB_Connect, DSV, "", "");
       SCM(playerid, -1,"{00FF00}Masina a fost transferata cu succes!");
   }

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
16 minutes ago, BaFFyJunior said:

if(strcmp(Vehicles[playerid][vehOwner], PlayerName(playerid)))

inlocuieste cu seterid.

Am incercat, dar nu a mers. Mi-a transferat doar o singura masina :) Problema este la ID, nu stiu cum pot face sa-mi citeasca toate ID-urile la vehiculele pe care le detin. Am gasit o modalitate cu ''for(new i = 0; i < MAX_VEH; i++)'' dar primesc multe erori de la MySQL chiar daca masinile mi se transfera.

Cunosti alta solutie ? Multumesc !

Edited by Gasi244
Link to comment
Share on other sites

  • 0

salutare, verifica cum ai comanda /vehicles si incearca de acolo sa adaptezi de acolo, sau mai bine posteaza comanda aici

  • Like 1
  • Thanks 1

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
6 minutes ago, Mister said:

salutare, verifica cum ai comanda /vehicles si incearca de acolo sa adaptezi de acolo, sau mai bine posteaza comanda aici

Salut !  

Comanda mea este urmatoarea:

CMD:mycars(playerid, params[])
{
        new bool:found = false;
        new szDialog[2000] = "ID\tVehicle\tPremium\n";
        //----------------------------------------------------------------------
        for(new i = 0; i < MAX_VEH; i++)
        {
                if(!Vehicles[i][vehStatus]) continue;
                //--------------------------------------------------------------
                if(!strcmp(Vehicles[i][vehOwner], PlayerName(playerid)))
                {
                        found = true;
                        format(szDialog, sizeof(szDialog), "%s{FFFFFF}#%d\t{FFE600}%s\t{00FF04}Yes\n", szDialog, Vehicles[i][vehID], vNames[Vehicles[i][vehModel] - 400]);
                }
                //--------------------------------------------------------------
        }
        //----------------------------------------------------------------------
        if(found)
        {
                ShowPlayerDialog(playerid, PCar_D+3, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Select a vehicle to manage", szDialog, "Select", "Cancel");
        }
        //----------------------------------------------------------------------
        else
        {
                SendError2(playerid, "You don't own any personal vehicles!", "Nu detii niciun vehicul personal!");
        }
        //----------------------------------------------------------------------
        return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.