Jump to content
  • 0

Problema tunning masina personala


Cristi69

Question

Problema intalnita (descriere):Nu se salveaza tunning-ul la masina persoanala. La gamemode-ul creeat de EDISON gen b-****
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu):    case 2: { // tow
                    if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your car isn't spawned!");
                    if(PlayerInfo[playerid][pCash] < 500) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your don't have $500!");
                    if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Vehicle is ocuppied!");
                    SetVehicleToRespawn(CarInfo[vsid][Spawned]);
                    SetTunning(vsid);
                    GivePlayerCash(playerid, -500);
                    SBizzInfo[11][sbTill] += 500;
                    mysql_format(SQL, string,sizeof(string),"UPDATE sbizz SET Till = %d WHERE ID = %d",SBizzInfo[11][sbTill],5);
                    mysql_tquery(SQL, string, "", "");
                    format(string, sizeof(string), "{FFB870}Your %s is now at its parking place.", aVehicleNames[CarInfo[vsid][cModel]-400]);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
                case 3: { // despawn & spawn
                    if(CarInfo[vsid][Spawned] == 0) {
                        CarInfo[vsid][Spawned] = CreateVehicle(CarInfo[vsid][cModel],CarInfo[vsid][cLocationx],CarInfo[vsid][cLocationy],CarInfo[vsid][cLocationz],CarInfo[vsid][cAngle],CarInfo[vsid][cColorOne],CarInfo[vsid][cColorTwo],-1);
                        SetTunning(vsid);
                        if(CarInfo[PlayerInfo[playerid][pCarKey1]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][0] = 1800;
                        else if(CarInfo[PlayerInfo[playerid][pCarKey2]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][1] = 1800;
                        else if(CarInfo[PlayerInfo[playerid][pCarKey3]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][2] = 1800;
                        else if(CarInfo[PlayerInfo[playerid][pCarKey4]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][3] = 1800;
                        else if(CarInfo[PlayerInfo[playerid][pCarKey5]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][4] = 1800;
                        format(string, sizeof(string), "{FFB870}Your %s has been spawned.", aVehicleNames[CarInfo[vsid][cModel]-400]);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[vsid][Spawned], vsid);
                        mysql_tquery(SQL, string, "", "");
                    }
                    else {
                        if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Vehicle is ocuppied!");
                        if(CarInfo[PlayerInfo[playerid][pCarKey1]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][0] = -1;
                        else if(CarInfo[PlayerInfo[playerid][pCarKey2]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][1] = -1;
                        else if(CarInfo[PlayerInfo[playerid][pCarKey3]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][2] = -1;
                        else if(CarInfo[PlayerInfo[playerid][pCarKey4]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][3] = -1;
                        else if(CarInfo[PlayerInfo[playerid][pCarKey5]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][4] = -1;
                        DestroyVehicle(CarInfo[vsid][Spawned]);
                        CarInfo[vsid][Spawned] = 0;
                        format(string, sizeof(string), "{FFB870}Your %s has been despawned.", aVehicleNames[CarInfo[vsid][cModel]-400]);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[vsid][Spawned], vsid);
                        mysql_tquery(SQL, string, "", "");
                    }
                }

Imagini / Video (optional): 
Ati incercat sa rezolvati singur?: Desigur , dar nu am reusit . Stau la el de 4 ore.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 1

Ai o functie anume care salveaza datele masinilor in baza de date sau arata-ne  codurile ce au legatura cu salvarea datelor pentru fiecare vehicul personal. Ofera mai multe detalii, la respawn dispare tuningul sau doar la relog / restart ?

Cea mai sigura sursa de facut bani de buzunar in mediul virtual. Inregistreaza-te si pune-te pe treaba !!!

http://www.viespar.ro/?reff=ab8e9d8086304d6136eac03c710238d7

Link to comment
Share on other sites

  • 0

function SetTunning(idd)
{
    new carid = CarInfo[idd][Spawned];
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(carid,0,lights,alarm,CarInfo[idd][cLock],bonnet,boot,objective);
    if(CarInfo[idd][mod0] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod0]);
    }
    if(CarInfo[idd][mod1] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod1]);
    }
    if(CarInfo[idd][mod2] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod2]);
    }
    if(CarInfo[idd][mod3] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod3]);
    }
    if(CarInfo[idd][mod4] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod4]);
    }
    if(CarInfo[idd][mod5] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod5]);
    }
    if(CarInfo[idd][mod6] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod6]);
    }
    if(CarInfo[idd][mod7] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod7]);
    }
    if(CarInfo[idd][mod8] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod8]);
    }
    if(CarInfo[idd][mod9] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod9]);
    }
    if(CarInfo[idd][mod10] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod10]);
    }
    if(CarInfo[idd][mod11] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod11]);
    }
    if(CarInfo[idd][mod12] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod12]);
    }
    if(CarInfo[idd][mod13] != 0)
    {
        AddVehicleComponent(carid,CarInfo[idd][mod13]);
    }
    SetVehicleNumberPlate(carid,CarInfo[idd][cLicense]);
}

stock FindEmptyID()
{
    new i;
    for(i = 1; i <= pvehs; i++)
    {
        if(CarInfo[cID] == -2)
        {
            return i;
        }
    }
    return 0;
}

stock FindSpawnID(car)
{
    new i;
    for(i = 1; i <= pvehs; i++)
    {
        if(CarInfo[Spawned] == car)
        {
            return i;
        }
    }
    return 0;
}

stock GetClosestVehicle(playerid)
{
    new closestdist = 999999999, closestvehicle = -1;
    new Float:x[2],Float:y[2],Float:z[2],distance;
    for(new i; i < MAX_VEHICLES; i++)
    {
        GetVehiclePos(i,x[0],y[0],z[0]);
        //if(x[0] == 0.0 && y[0] == 0.0 && z[0] == 0.0) return -1;
        GetPlayerPos(playerid,x[1],y[1],z[1]);
        distance = floatround(GetDistanceBetweenPoints(x[0],y[0],z[0],x[1],y[1],z[1]));
        if(distance < closestdist) {
            closestdist = distance;
            closestvehicle = i;
        }
    }
    return closestvehicle;
}

Link to comment
Share on other sites

  • 0

SetTunning iti seteaza tuningul pe o masina, ai o alta functie sau un cod care iti salveaza tuningul pe o masina sau daca nu ai asa trebuie sa ai.

Edited by Jamal Alin

Cea mai sigura sursa de facut bani de buzunar in mediul virtual. Inregistreaza-te si pune-te pe treaba !!!

http://www.viespar.ro/?reff=ab8e9d8086304d6136eac03c710238d7

Link to comment
Share on other sites

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.