Jump to content
  • 0

Nu se salveaza tunningul GM Edison 2017


Question

Posted

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;       
    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;
}

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.