Jump to content
  • 0

Ajutor DealerShip [Vanzare masina]


Extremys

Question

Problema intalnita (descriere):Mi se incurca preturile sa zic asa de exemplu cumapr un sultan care este 3kk iar cand ma duc sa il vand imi da bani 52.500.000$ bani care trebuia sa mi dea pe infernus, iar la nrg la fel pretul este 40kk iar el imi da inapoi bani dupa sultan.
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul(obligatoriu):
Imagini / Video (optional):
Ati incercat sa rezolvati singur?:

Spoiler

if(strcmp(cmd, "/sellcar", true) == 0)


      {
        if(PlayerToPoint(10.0, playerid,329.3534,-1511.9949,36.039))
        {
            if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey3] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey4])
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new ownvehkey;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey]) { ownvehkey = PlayerInfo[playerid][pCarKey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey2]) { ownvehkey = PlayerInfo[playerid][pCarKey2]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey3]) { ownvehkey = PlayerInfo[playerid][pCarKey3]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey4]) { ownvehkey = PlayerInfo[playerid][pCarKey4]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey5]) { ownvehkey = PlayerInfo[playerid][pCarKey5]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey6]) { ownvehkey = PlayerInfo[playerid][pCarKey6]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey7]) { ownvehkey = PlayerInfo[playerid][pCarKey7]; }
                else { return 1; }
                if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
                {
                    new carsellprice = CarInfo[ownvehkey][cValue] / 4 * 3;
                    new Float:x,Float:y,Float:z;
                    new Float:a;
                    CarInfo[ownvehkey][cOwned] = 0;
                    strmid(CarInfo[ownvehkey][cOwner], "Dealership", 0, strlen("Dealership"), 999);
                    GivePlayerCash(playerid,carsellprice);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    format(string, sizeof(string), "Ti-ai vandut vehiculul personal pentru suma de %s $.", FormatNumber(carsellprice));
                    SCM(playerid, -1, string);
                    GetVehiclePos(ownvehkey, x, y, z);
                    GetVehicleZAngle(ownvehkey, a);
                    CarInfo[ownvehkey][cLocationx] = 10000;
                    CarInfo[ownvehkey][cLocationy] = 10000;
                    CarInfo[ownvehkey][cLocationz] = 10000;
                    CarInfo[ownvehkey][cAngle] = a;
                    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey]) { PlayerInfo[playerid][pCarKey] = 999; }
                    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey2]) { PlayerInfo[playerid][pCarKey2] = 999; }
                    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey3]) { PlayerInfo[playerid][pCarKey3] = 999; }
                    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey4]) { PlayerInfo[playerid][pCarKey4] = 999; }
                    RemovePlayerFromVehicle(playerid);
                    TogglePlayerControllable(playerid, 1);
                    if(PlayerInfo[playerid][pLocal] == ownvehkey)
                    {
                        SetPlayerInterior(playerid,0);
                        SetPlayerPos(playerid,CarInfo[ownvehkey][cLocationx],CarInfo[ownvehkey][cLocationy],CarInfo[ownvehkey][cLocationz]);
                        PlayerInfo[playerid][pInt] = 0;
                    }
                    new vehid = GetPlayerVehicleID(playerid);
                    CarInfo[vehid][cPaintJ] = 3;
                    CarInfo[vehid][cColorOne] = 1;
                    CarInfo[vehid][cColorTwo] = 1;
                    CarInfo[vehid][mod1] = 0;
                    CarInfo[vehid][mod2] = 0;
                    CarInfo[vehid][mod3] = 0;
                    CarInfo[vehid][mod4] = 0;
                    CarInfo[vehid][mod5] = 0;
                    CarInfo[vehid][mod6] = 0;
                    CarInfo[vehid][mod7] = 0;
                    CarInfo[vehid][mod8] = 0;
                    CarInfo[vehid][mod9] = 0;
                    CarInfo[vehid][mod10] = 0;
                    CarInfo[vehid][mod11] = 0;
                    CarInfo[vehid][mod12] = 0;
                    CarInfo[vehid][mod13] = 0;
                    CarInfo[vehid][mod14] = 0;
                    CarInfo[vehid][mod15] = 0;
                    CarInfo[vehid][mod16] = 0;
                    CarInfo[vehid][mod17] = 0;
                    CarInfo[vehid][cNeon] = 0;
                    CarInfo[vehid][cLock] = 0;
                    ChangeVehiclePaintjob(vehid, 3);
                    vehEngine[vehid] = 0;
                    GetVehicleParamsEx(vehid,engine,lights,alarm,doors,bonnet,boot,objective);
                      SetVehicleParamsEx(vehid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                    for(new i = 0; i < 14; i++)
                    {
                        RemoveVehicleComponent(vehid, GetVehicleComponentInSlot(vehid, i));
                    }
                    ChangeVehicleColor(vehid, CarInfo[vehid][cColorOne], CarInfo[vehid][cColorTwo]);
                    OnPropUpdate();
                    DestroyVehicle(ownvehkey);
                    CreateVehicle(CarInfo[ownvehkey][cModel],CarInfo[ownvehkey][cLocationx],CarInfo[ownvehkey][cLocationy],CarInfo[ownvehkey][cLocationz]+1.0,CarInfo[ownvehkey][cAngle],CarInfo[ownvehkey][cColorOne],CarInfo[ownvehkey][cColorTwo],60000);
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "Trebuie sa fii in vehicul pentru a-l vinde!");
                return 1;
            }
        }
        return 1;
    }

sa-mp-229.png

sa-mp-228.png

Edited by Extremys

giphy.gif

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey3] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey4])
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new ownvehkey;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey]) { ownvehkey = PlayerInfo[playerid][pCarKey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey2]) { ownvehkey = PlayerInfo[playerid][pCarKey2]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey3]) { ownvehkey = PlayerInfo[playerid][pCarKey3]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey4]) { ownvehkey = PlayerInfo[playerid][pCarKey4]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey5]) { ownvehkey = PlayerInfo[playerid][pCarKey5]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey6]) { ownvehkey = PlayerInfo[playerid][pCarKey6]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey7]) { ownvehkey = PlayerInfo[playerid][pCarKey7]; }
                else { return 1; }

cum vine asta ? 

 

Link to comment
Share on other sites

  • 0
Acum 16 minute, kiLLers10 a spus:

if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey3] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey4])
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new ownvehkey;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey]) { ownvehkey = PlayerInfo[playerid][pCarKey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey2]) { ownvehkey = PlayerInfo[playerid][pCarKey2]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey3]) { ownvehkey = PlayerInfo[playerid][pCarKey3]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey4]) { ownvehkey = PlayerInfo[playerid][pCarKey4]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey5]) { ownvehkey = PlayerInfo[playerid][pCarKey5]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey6]) { ownvehkey = PlayerInfo[playerid][pCarKey6]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey7]) { ownvehkey = PlayerInfo[playerid][pCarKey7]; }
                else { return 1; }

cum vine asta ? 

 

Eu v-am rugat sa ma ajutati sa rezolv, nu e facut de mine sistemul

Daca asi adauga:

new carsellprice = vehPrice[CarInfo[ownvehkey][cModel]] / 4 * 3;

vehStock[CarInfo[ownvehkey][cModel]]++;
SaveVehStock();

 

in locul new carsellprice = CarInfo[ownvehkey][cValue] / 4 * 3; ar creste si modelul masini si cred ca mi-ar da si bani nu?

giphy.gif

Link to comment
Share on other sites

  • 0
Guest
This topic is now closed to further replies.
×
×
  • 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.