Jump to content
  • 0

tunning-ul nu se salveaza


AndreiADD

Question

4 answers to this question

Recommended Posts

  • 0
Acum 9 minute, PawnFox a spus:

Ne arati si noua comanda sau codul prin care ar fi trebuit sa salveze 'tuning-ul'. Nu avem cum sa te ajutam daca nu ne arati codul.

CMD:park(playerid, params[])
{
    new string[128], idd;
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Nu esti intr-un vehicul!");
    new car = GetPlayerVehicleID(playerid);
    if(PersonalCar(playerid) == -1) return SCM(playerid, COLOR_LGREEN, "* Nu esti in unul dintre vehiculele tale personale!");
    idd = PersonalCar(playerid);
    if(CarInfo[idd][Spawned] != car) return SendClientMessage(playerid, COLOR_GREY, "Nu esti in vehiculul tau!");
    if(idd == 0) return SendClientMessage(playerid, COLOR_GREY, "Acest vehicul nu iti apartine!");
    new Float:x, Float:y, Float:z, Float:a;
    GetVehiclePos(car, x, y, z);
    GetVehicleZAngle(car, a);
    CarInfo[idd][cLocationx] = x;
    CarInfo[idd][cLocationy] = y;
    CarInfo[idd][cLocationz] = z;
    CarInfo[idd][cAngle] = a;
    VehicleOwned[CarInfo[idd][Spawned]] = 0;
    VehicleSQL[CarInfo[idd][Spawned]] = 0;    
    DestroyVehicle(car);
    CheckVehicle(car);
    if(strlen(CarInfo[idd][cText]) >= 3) {
        DestroyDynamicObject(nameobject[CarInfo[idd][Spawned]]);
    }            
    CarInfo[idd][Spawned] = CreateVehicleEx(CarInfo[idd][cModel],CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],CarInfo[idd][cAngle],CarInfo[idd][cColorOne],CarInfo[idd][cColorTwo],-1);
    VehicleOwned[CarInfo[idd][Spawned]] = CarInfo[idd][Spawned];
    VehicleSQL[CarInfo[idd][Spawned]] = idd;       
    SetTunning(car);
    attach_vip_text(idd);
    SetVehicleNumberPlate(CarInfo[idd][Spawned], CarInfo[idd][cLicense]);
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Locationx='%f' WHERE ID=%d", CarInfo[idd][cLocationx], idd);
    mysql_tquery(SQL, string, "", "");
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Locationy='%f' WHERE ID=%d", CarInfo[idd][cLocationy], idd);
    mysql_tquery(SQL, string, "", "");
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Locationz='%f' WHERE ID=%d", CarInfo[idd][cLocationz], idd);
    mysql_tquery(SQL, string, "", "");
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Angle='%f' WHERE ID=%d", CarInfo[idd][cAngle], idd);
    mysql_tquery(SQL, string, "", "");
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[idd][Spawned], idd);
    mysql_tquery(SQL, string, "", "");
    SCM(playerid, 0xFFBABAFF, "Vehicul parcat!");
    return 1;
}

function CheckVehicle(carid) {
    foreach(Player, i) {
        if(IsPlayerConnected(i)) {
            if(VehicleKey == carid) VehicleKey = 0;
        }
    }
    return 1;
}

 

Link to comment
Share on other sites

  • 0
On 12/12/2018 at 4:21 PM, AndreiADD said:

CMD:park(playerid, params[])
{
    new string[128], idd;
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Nu esti intr-un vehicul!");
    new car = GetPlayerVehicleID(playerid);
    if(PersonalCar(playerid) == -1) return SCM(playerid, COLOR_LGREEN, "* Nu esti in unul dintre vehiculele tale personale!");
    idd = PersonalCar(playerid);
    if(CarInfo[idd][Spawned] != car) return SendClientMessage(playerid, COLOR_GREY, "Nu esti in vehiculul tau!");
    if(idd == 0) return SendClientMessage(playerid, COLOR_GREY, "Acest vehicul nu iti apartine!");
    new Float:x, Float:y, Float:z, Float:a;
    GetVehiclePos(car, x, y, z);
    GetVehicleZAngle(car, a);
    CarInfo[idd][cLocationx] = x;
    CarInfo[idd][cLocationy] = y;
    CarInfo[idd][cLocationz] = z;
    CarInfo[idd][cAngle] = a;
    VehicleOwned[CarInfo[idd][Spawned]] = 0;
    VehicleSQL[CarInfo[idd][Spawned]] = 0;    
    DestroyVehicle(car);
    CheckVehicle(car);
    if(strlen(CarInfo[idd][cText]) >= 3) {
        DestroyDynamicObject(nameobject[CarInfo[idd][Spawned]]);
    }            
    CarInfo[idd][Spawned] = CreateVehicleEx(CarInfo[idd][cModel],CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],CarInfo[idd][cAngle],CarInfo[idd][cColorOne],CarInfo[idd][cColorTwo],-1);
    VehicleOwned[CarInfo[idd][Spawned]] = CarInfo[idd][Spawned];
    VehicleSQL[CarInfo[idd][Spawned]] = idd;       
    SetTunning(car);
    attach_vip_text(idd);
    SetVehicleNumberPlate(CarInfo[idd][Spawned], CarInfo[idd][cLicense]);
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Locationx='%f' WHERE ID=%d", CarInfo[idd][cLocationx], idd);
    mysql_tquery(SQL, string, "", "");
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Locationy='%f' WHERE ID=%d", CarInfo[idd][cLocationy], idd);
    mysql_tquery(SQL, string, "", "");
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Locationz='%f' WHERE ID=%d", CarInfo[idd][cLocationz], idd);
    mysql_tquery(SQL, string, "", "");
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Angle='%f' WHERE ID=%d", CarInfo[idd][cAngle], idd);
    mysql_tquery(SQL, string, "", "");
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[idd][Spawned], idd);
    mysql_tquery(SQL, string, "", "");
    SCM(playerid, 0xFFBABAFF, "Vehicul parcat!");
    return 1;
}

function CheckVehicle(carid) {
    foreach(Player, i) {
        if(IsPlayerConnected(i)) {
            if(VehicleKey == carid) VehicleKey = 0;
        }
    }
    return 1;
}

 

Pai, nu se salveaza deoarece nu ai pus o variabila care sa le salveze in baza de date.

maxresdefault.jpg

 

 

 

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.