Jump to content

Problema


david1995

Recommended Posts

9 minutes ago, Extremys said:

 

Aratane comanda /buycar si dialogul care il ai la OndialogResponse despre DS

Quote

CMD:buycar(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 329.3534,-1511.9949,36.0391))
    {
        if(playerVariables[playerid][pLevel] >= 2)
        {
         if(!PlayerToPoint(5.0,playerid,326.0295,-1515.6128,36.0325)) return SendClientMessage(playerid,COLOR_WHITE,"Nu esti la Dealership!");
        TogglePlayerControllable(playerid, 0);
        SelectTextDraw(playerid, COLOR_ATTACK);
        SetPlayerPos(playerid, 302.8166,-1520.3934,24.5938);
        TextDrawShowForPlayer(playerid,Linie[playerid]);
        TextDrawShowForPlayer(playerid,ButonInapoi[playerid]);
        TextDrawShowForPlayer(playerid,ButonUrmator[playerid]);
        TextDrawShowForPlayer(playerid,ButonCumpara[playerid]);
        TextDrawShowForPlayer(playerid,ButonTesteaza[playerid]);
        TextDrawShowForPlayer(playerid,ButonAnuleaza[playerid]);
        SetPlayerCameraPos(playerid,297.3579,-1522.0531,26.9481);
        SetPlayerCameraLookAt(playerid,287.7292,-1519.3615,24.5938);
        SetPlayerVirtualWorld(playerid, playerid+1);
        IDDS[playerid] = 0;
        IDmasina[playerid] = CreateVehicle(DSModele[IDDS[playerid]],290.6555,-1519.3146,24.2704,259.6917,1,1,-1);
        SetVehicleVirtualWorld(IDmasina[playerid],playerid+1);

        new string [128];

        //Numele
        format(string,sizeof(string),"Masina: %s",aVehicleNames[DSModele[IDDS[playerid]]-400]);
        TextDrawSetString(DealerMasina[playerid],string);
        TextDrawShowForPlayer(playerid,DealerMasina[playerid]);

        //Pret
        format(string,sizeof(string),"Pret: %d",vehPrice[DSModele[IDDS[playerid]]]);
        TextDrawSetString(DealerPret[playerid],string);
        TextDrawShowForPlayer(playerid,DealerPret[playerid]);
        }
        else return SCM(playerid,COLOR_WHITE,"Nu ai level 2.");
    }
    else return SCM(playerid,COLOR_WHITE,"Nu esti la dealership.");
    return 1;
}

si

Quote

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    new string[128];
    if(clickedid == ButonInapoi[playerid])
    {
        if(IDDS[playerid] == 0)
        {
            IDDS[playerid] = 0;
              DestroyVehicle(IDmasina[playerid]);
            IDmasina[playerid] = CreateVehicle(DSModele[IDDS[playerid]],290.6555,-1519.3146,24.2704,259.6917,1,1,-1);
            SetVehicleVirtualWorld(IDmasina[playerid],playerid+1);
            
            //Numele
            format(string,sizeof(string),"Masina: %s",aVehicleNames[DSModele[IDDS[playerid]]-400]);
            TextDrawSetString(DealerMasina[playerid],string);
            TextDrawShowForPlayer(playerid,DealerMasina[playerid]);

            //Pret
            format(string,sizeof(string),"Pret: %d",vehPrice[DSModele[IDDS[playerid]]]);
            TextDrawSetString(DealerPret[playerid],string);
            TextDrawShowForPlayer(playerid,DealerPret[playerid]);
        }
        else
        {
            IDDS[playerid] -= 1;
            DestroyVehicle(IDmasina[playerid]);
            IDmasina[playerid] = CreateVehicle(DSModele[IDDS[playerid]],290.6555,-1519.3146,24.2704,259.6917,1,1,-1);
            SetVehicleVirtualWorld(IDmasina[playerid],playerid+1);

            //Numele
            format(string,sizeof(string),"Masina: %s",aVehicleNames[DSModele[IDDS[playerid]]-400]);
            TextDrawSetString(DealerMasina[playerid],string);
            TextDrawShowForPlayer(playerid,DealerMasina[playerid]);

            //Pret
            format(string,sizeof(string),"Pret: %d",vehPrice[DSModele[IDDS[playerid]]]);
            TextDrawSetString(DealerPret[playerid],string);
            TextDrawShowForPlayer(playerid,DealerPret[playerid]);
        }
    }
    if(clickedid == ButonUrmator[playerid])
    {
        if(DSModele[IDDS[playerid]] == 0)
        {
            IDDS[playerid] = 0;
            DestroyVehicle(IDmasina[playerid]);
            IDmasina[playerid] = CreateVehicle(DSModele[IDDS[playerid]],290.6555,-1519.3146,24.2704,259.6917,1,1,-1);
            SetVehicleVirtualWorld(IDmasina[playerid],playerid+1);

            //Numele
            format(string,sizeof(string),"Masina: %s",aVehicleNames[DSModele[IDDS[playerid]]-400]);
            TextDrawSetString(DealerMasina[playerid],string);
            TextDrawShowForPlayer(playerid,DealerMasina[playerid]);

            //Pret
            format(string,sizeof(string),"Pret: %d",vehPrice[DSModele[IDDS[playerid]]]);
            TextDrawSetString(DealerPret[playerid],string);
            TextDrawShowForPlayer(playerid,DealerPret[playerid]);
        }
        else
        {
            IDDS[playerid] += 1;
            DestroyVehicle(IDmasina[playerid]);
            IDmasina[playerid] = CreateVehicle(DSModele[IDDS[playerid]],290.6555,-1519.3146,24.2704,259.6917,1,1,-1);
            SetVehicleVirtualWorld(IDmasina[playerid],playerid+1);

            //Numele
            format(string,sizeof(string),"Masina: %s",aVehicleNames[DSModele[IDDS[playerid]]-400]);
            TextDrawSetString(DealerMasina[playerid],string);
            TextDrawShowForPlayer(playerid,DealerMasina[playerid]);

            //Pret
            format(string,sizeof(string),"Pret: %d",vehPrice[DSModele[IDDS[playerid]]]);
            TextDrawSetString(DealerPret[playerid],string);
            TextDrawShowForPlayer(playerid,DealerPret[playerid]);
        }

    }
    if(clickedid == ButonCumpara[playerid])
    {

        DestroyVehicle(IDmasina[playerid]);
        SetPlayerVirtualWorld(playerid,0);
        TogglePlayerControllable(playerid,1);
        SetCameraBehindPlayer(playerid);
        TextDrawHideForPlayer(playerid,Linie[playerid]);
        TextDrawHideForPlayer(playerid,ButonInapoi[playerid]);
        TextDrawHideForPlayer(playerid,ButonUrmator[playerid]);
        TextDrawHideForPlayer(playerid,ButonCumpara[playerid]);
        TextDrawHideForPlayer(playerid,ButonTesteaza[playerid]);
        TextDrawHideForPlayer(playerid,ButonAnuleaza[playerid]);
        TextDrawHideForPlayer(playerid,ButonInapoi[playerid]);
        TextDrawHideForPlayer(playerid,ButonUrmator[playerid]);
        TextDrawHideForPlayer(playerid,DealerPret[playerid]);
        TextDrawHideForPlayer(playerid,DealerMasina[playerid]);
        CancelSelectTextDraw(playerid);
        PurchaseVehicleFromDealer(playerid, DSModele[IDDS[playerid]], vehPrice[DSModele[IDDS[playerid]]], vehPprice[DSModele[IDDS[playerid]]]);
        SetPlayerPos(playerid, 329.3534,-1511.9949,36.0391);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);

    }
    if(clickedid == ButonTesteaza[playerid])
    {
         SendClientMessage(playerid, COLOR_WHITE, "Ai 30 de secunde sa testezi masina!");
         SetTimerEx("TimpScurs",30 * 1000,0,"d",playerid);
         SetVehicleVirtualWorld(IDmasina[playerid],0);
         SetPlayerVirtualWorld(playerid,0);
         SetVehiclePos(IDmasina[playerid] ,-1624.0968,1242.2070,7.0468);
         PutPlayerInVehicle(playerid,IDmasina[playerid],0);
         TogglePlayerControllable(playerid,1);
         SetCameraBehindPlayer(playerid);
         TextDrawHideForPlayer(playerid,Linie[playerid]);
         TextDrawHideForPlayer(playerid,ButonInapoi[playerid]);
         TextDrawHideForPlayer(playerid,ButonUrmator[playerid]);
         TextDrawHideForPlayer(playerid,ButonCumpara[playerid]);
         TextDrawHideForPlayer(playerid,ButonTesteaza[playerid]);
         TextDrawHideForPlayer(playerid,ButonAnuleaza[playerid]);
         TextDrawHideForPlayer(playerid,DealerPret[playerid]);
         TextDrawHideForPlayer(playerid,DealerMasina[playerid]);
         CancelSelectTextDraw(playerid);
    }
    if(clickedid == ButonAnuleaza[playerid])
    {
        DestroyVehicle(IDmasina[playerid]);
        SetPlayerVirtualWorld(playerid,0);
        TogglePlayerControllable(playerid,1);
        SetCameraBehindPlayer(playerid);
        TextDrawHideForPlayer(playerid,Linie[playerid]);
        TextDrawHideForPlayer(playerid,ButonInapoi[playerid]);
        TextDrawHideForPlayer(playerid,ButonUrmator[playerid]);
        TextDrawHideForPlayer(playerid,ButonCumpara[playerid]);
        TextDrawHideForPlayer(playerid,ButonTesteaza[playerid]);
        TextDrawHideForPlayer(playerid,ButonAnuleaza[playerid]);
        TextDrawHideForPlayer(playerid,DealerPret[playerid]);
        TextDrawHideForPlayer(playerid,DealerMasina[playerid]);
        CancelSelectTextDraw(playerid);
        SetPlayerPos(playerid, 329.3534,-1511.9949,36.0391);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);

    }
    return 1;
}

sau 

Quote

    case DIALOG_BUYCAR:
        {
            if(response)
            {
                new stringbuycar[1500];
                switch(listitem)
                {
                    case 0:
                    {
                        format(stringbuycar,sizeof(stringbuycar),"Perrenial (Price: %d$) (Stock: %d)\nSadler (Price: %d$) (Stock: %d)\nMoonbean (Price: %d$) (Stock: %d)\nBravura (Price: %d$) (Stock: %d)\nHermes (Price: %d$) (Stock: %d)\nSunrise (Price: %d$) (Stock: %d)\nBuritto (Price: %d$) (Stock: %d)\nMesa (Price: %d$) (Stock: %d)\nStallion (Price: %d$) (Stock: %d)\nHotknife (Price: %d$) (Stock: %d)",vehPrice[404],vehSlots[404],
                        vehPrice[543],vehSlots[543],vehPrice[418],vehSlots[418],vehPrice[401],vehSlots[401],vehPrice[474],vehSlots[474],
                        vehPrice[550],vehSlots[550],vehPrice[482],vehSlots[482],vehPrice[500],vehSlots[500],vehPrice[439],vehSlots[439],vehPrice[434],vehSlots[434]);
                        ShowPlayerDialog(playerid, DIALOG_BUYCAR_CRAP, DIALOG_STYLE_LIST, "Cheap Vehicles", stringbuycar, "Select", "Cancel");
                    }
                    case 1:
                    {
                        format(stringbuycar,sizeof(stringbuycar),"Stratum (Price: %d$) (Stock: %d)\nHustler (Price: %d$) (Stock: %d)\nBlista Compact (Price: %d$) (Stock: %d)\nSavanna (Price: %d$) (Stock: %d)\nSlamvan (Price: %d$) (Stock: %d)\nPremier (Price: %d$) (Stock: %d)\nPheonix (Price: %d$) (Stock: %d)",vehPrice[561], vehSlots[561],vehPrice[545],vehSlots[545],vehPrice[496],vehSlots[496],vehPrice[567],vehSlots[567],vehPrice[535],vehSlots[535],vehPrice[426],
                        vehSlots[426],vehPrice[603],vehSlots[603]);
                         ShowPlayerDialog(playerid, DIALOG_BUYCAR_CLASSIC, DIALOG_STYLE_LIST, "Normal Vehicles",stringbuycar, "Select", "Cancel");
                     }
                    case 2:
                    {
                        format(stringbuycar,sizeof(stringbuycar),"Rancher (Price: %d$) (Stock: %d)\nEuros (Price: %d$) (Stock: %d)\nHuntley (Price: %d$) (Stock: %d)\nFlash (Price: %d$) (Stock: %d)\nUranus (Price: %d$) (Stock: %d)\nSandking (Price: %d$) (Stock: %d)\nComet (Price: %d$) (Stock: %d)\nElegy (Price: %d$) (Stock: %d)\nJester (Price: %d$) (Stock: %d)\nBuffalo (Price: %d$) (Stock: %d)",vehPrice[489], vehSlots[489],vehPrice[587],vehSlots[587],vehPrice[579],vehSlots[579],
                        vehPrice[565],vehSlots[565],vehPrice[558],vehSlots[558],vehPrice[495],vehSlots[495],
                        vehPrice[480],vehSlots[480],vehPrice[562],vehSlots[562],vehPrice[559],vehSlots[559],vehPrice[402],vehSlots[402]);
                        ShowPlayerDialog(playerid, DIALOG_BUYCAR_SEDAN, DIALOG_STYLE_LIST, "Expensive Vehicles",stringbuycar, "Select", "Cancel");
                    }
                    case 3:
                    {
                        format(stringbuycar,sizeof(stringbuycar),"Cheetah (Price: %d$) (Stock: %d)\nSultan (Price: %d$) (Stock: %d)\nBanshee (Price: %d$) (Stock: %d)\nTurismo (Price: %d$) (Stock: %d)\nBullet (Price: %d$) (Stock: %d)\nInfernus (Price: %d$) (Stock: %d)",vehPrice[415],vehSlots[415],vehPrice[560],vehSlots[560],vehPrice[429],vehSlots[429],vehPrice[451],vehSlots[451],vehPrice[541],vehSlots[541],vehPrice[411],vehSlots[411]);
                        ShowPlayerDialog(playerid, DIALOG_BUYCAR_SUV, DIALOG_STYLE_LIST, "Lux Vehicles",stringbuycar, "Select", "Cancel");
                    }
                    case 4:
                    {
                        format(stringbuycar,sizeof(stringbuycar),"Faggio (Price: %d$) (Stock: %d)\nQuad (Price: %d$) (Stock: %d)\nWayfarer (Price: %d$) (Stock: %d)\nFreeway (Price: %d$) (Stock: %d)\nSanchez (Price: %d$) (Stock: %d)\nPCJ-600 (Price: %d$) (Stock: %d)\nFCR-900 (Price: %d$) (Stock: %d)\nNRG-500 (Price: %d$) (Stock: %d)",vehPrice[462],vehSlots[462],vehPrice[471],vehSlots[471],vehPrice[586],vehSlots[586],vehPrice[463],vehSlots[463],vehPrice[468],vehSlots[468],vehPrice[461],vehSlots[461],
                        vehPrice[521],vehSlots[521],vehPrice[522],vehSlots[522]);
                        ShowPlayerDialog(playerid, DIALOG_BUYCAR_BIKE, DIALOG_STYLE_LIST, "Motorcycles",stringbuycar, "Select", "Cancel");
                    }
                    case 5:
                    {
                        format(stringbuycar,sizeof(stringbuycar),"Spearrow (100 PP) (Stock: %d)\nMaverick (100 PP) (Stock: %d)\nHotring Racer (100 PP) (Stock: %d)\nBMX (200 PP) (Stock: %d)\nMountaine Bike (200 PP) (Stock: %d)",vehSlots[469],vehSlots[487],vehSlots[494],vehSlots[481],vehSlots[510]);
                        ShowPlayerDialog(playerid, DIALOG_BUYCAR_MUSCLE, DIALOG_STYLE_LIST, "Premium Vehicles", stringbuycar, "Select", "Cancel");
                    }
                }
            }
        }

Cred ca de astea aveti nevoie nu ?

Si eu ma refer la masinile Premium.

Edited by david1995
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
Reply to this topic...

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