Jump to content

Question

Posted

Problema este ca nu se salveaza tunningu.

[pawn]         else if(strcmp(x_nr,"park",true) == 0)

        {

            new Float:x,Float:y,Float:z;

new Float:a;

new carid;

new getcarid;

if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }

else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }

else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }

else { return 1; }

getcarid = GetPlayerVehicleID(playerid);

GetPlayerName(playerid, playername, sizeof(playername));

GetVehiclePos(carid, x, y, z);

//GetPlayerFacingAngle(playerid, a);

GetVehicleZAngle(carid, a);

if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)

{

  if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)

{

SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");

return 1;

}

if(getcarid == carid)

{

CarInfo[carid][cLocationx] = x;

CarInfo[carid][cLocationy] = y;

CarInfo[carid][cLocationz] = z;

CarInfo[carid][cAngle] = a;

format(string, sizeof(string), "~n~ You have parked your vehicle in this location. ~n~");

GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3);

OnPropUpdate();

OnPlayerUpdate(playerid);

DestroyVehicle(carid);

CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);

      TogglePlayerControllable(playerid, 1);

      new tunecar = GetPlayerVehicleID(playerid);

                        if(AvtoModification[tunecar][0] >= 1000 && AvtoModification[tunecar][0] <= 1193)

                    {

                      if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][0])) != AvtoModification[tunecar][0])

                          {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][0]);

                          }

                    }

                    if(AvtoModification[tunecar][1] >= 1000 && AvtoModification[tunecar][1] <= 1193)

                    {

                      if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][1])) != AvtoModification[tunecar][1])

                          {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][1]);

                          }

                    }

                    if(AvtoModification[tunecar][2] >= 1000 && AvtoModification[tunecar][2] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][2])) != AvtoModification[tunecar][2])

                            {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][2]);

                            }

                    }

                    if(AvtoModification[tunecar][3] >= 1000 && AvtoModification[tunecar][3] <= 1193)

                        {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][3])) != AvtoModification[tunecar][3])

                            {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][3]);

                            }

                    }

                    if(AvtoModification[tunecar][4] >= 1000 && AvtoModification[tunecar][4] <= 1193)

                        {

                            if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][4])) != AvtoModification[tunecar][4])

                            {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][4]);

                            }

                    }

                    if(AvtoModification[tunecar][5] >= 1000 && AvtoModification[tunecar][5] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][5])) != AvtoModification[tunecar][5])

                            {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][5]);

                            }

                        }

                    if(AvtoModification[tunecar][6] >= 1000 && AvtoModification[tunecar][6] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][6])) != AvtoModification[tunecar][6])

                            {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][6]);

                            }

                    }

                    if(AvtoModification[tunecar][7] >= 1000 && AvtoModification[tunecar][7] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][7])) != AvtoModification[tunecar][7])

                            {

                                AddVehicleComponent(tunecar,AvtoModification[tunecar][7]);

                            }

                    }

                    if(AvtoModification[tunecar][8] >= 1000 && AvtoModification[tunecar][8] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][8])) != AvtoModification[tunecar][8])

                            {

                                AddVehicleComponent(tunecar,AvtoModification[tunecar][8]);

                            }

                    }

                    if(AvtoModification[tunecar][9] >= 1000 && AvtoModification[tunecar][9] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][9])) != AvtoModification[tunecar][9])

                            {

                                AddVehicleComponent(tunecar,AvtoModification[tunecar][9]);

                            }

                    }

                        if(AvtoModification[tunecar][10] > 0)

                    {

                        ChangeVehiclePaintjob(tunecar,AvtoModification[tunecar][10]);

                    }

                    if(CarInfo[tunecar][cRegistered] == 1)

                    {

                            SetVehicleNumberPlate(tunecar, CarInfo[tunecar][cPlate]);

                }

                else

                {

                            SetVehicleNumberPlate(tunecar, CarInfo[tunecar][cPlate]);

                }

return 1;

  }

}

        }[/pawn]

1 answer to this question

Recommended Posts

Posted

Incearca asa

[pawn]else if(strcmp(x_nr,"park",true) == 0)

        {

            new Float:x,Float:y,Float:z;

new Float:a;

new carid;

new getcarid;

if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }

else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }

else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }

else { return 1; }

getcarid = GetPlayerVehicleID(playerid);

GetPlayerName(playerid, playername, sizeof(playername));

GetVehiclePos(carid, x, y, z);

//GetPlayerFacingAngle(playerid, a);

GetVehicleZAngle(carid, a);

if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)

{

  if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)

{

SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");

return 1;

}

if(getcarid == carid)

{

CarInfo[carid][cLocationx] = x;

CarInfo[carid][cLocationy] = y;

CarInfo[carid][cLocationz] = z;

CarInfo[carid][cAngle] = a;

format(string, sizeof(string), "~n~ You have parked your vehicle in this location. ~n~");

GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3);

OnPropUpdate();

OnPlayerUpdate(playerid);

DestroyVehicle(carid);

new vehicle = CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);

      PutPlayerInVehicle(playerid, vehicle, 0);

TogglePlayerControllable(playerid, 1);

      new tunecar = GetPlayerVehicleID(playerid);

                        if(AvtoModification[tunecar][0] >= 1000 && AvtoModification[tunecar][0] <= 1193)

                    {

                      if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][0])) != AvtoModification[tunecar][0])

                          {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][0]);

                          }

                    }

                    if(AvtoModification[tunecar][1] >= 1000 && AvtoModification[tunecar][1] <= 1193)

                    {

                      if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][1])) != AvtoModification[tunecar][1])

                          {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][1]);

                          }

                    }

                    if(AvtoModification[tunecar][2] >= 1000 && AvtoModification[tunecar][2] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][2])) != AvtoModification[tunecar][2])

                            {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][2]);

                            }

                    }

                    if(AvtoModification[tunecar][3] >= 1000 && AvtoModification[tunecar][3] <= 1193)

                        {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][3])) != AvtoModification[tunecar][3])

                            {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][3]);

                            }

                    }

                    if(AvtoModification[tunecar][4] >= 1000 && AvtoModification[tunecar][4] <= 1193)

                        {

                            if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][4])) != AvtoModification[tunecar][4])

                            {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][4]);

                            }

                    }

                    if(AvtoModification[tunecar][5] >= 1000 && AvtoModification[tunecar][5] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][5])) != AvtoModification[tunecar][5])

                            {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][5]);

                            }

                        }

                    if(AvtoModification[tunecar][6] >= 1000 && AvtoModification[tunecar][6] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][6])) != AvtoModification[tunecar][6])

                            {

                              AddVehicleComponent(tunecar,AvtoModification[tunecar][6]);

                            }

                    }

                    if(AvtoModification[tunecar][7] >= 1000 && AvtoModification[tunecar][7] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][7])) != AvtoModification[tunecar][7])

                            {

                                AddVehicleComponent(tunecar,AvtoModification[tunecar][7]);

                            }

                    }

                    if(AvtoModification[tunecar][8] >= 1000 && AvtoModification[tunecar][8] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][8])) != AvtoModification[tunecar][8])

                            {

                                AddVehicleComponent(tunecar,AvtoModification[tunecar][8]);

                            }

                    }

                    if(AvtoModification[tunecar][9] >= 1000 && AvtoModification[tunecar][9] <= 1193)

                    {

                        if(GetVehicleComponentInSlot(tunecar,GetVehicleComponentType(AvtoModification[tunecar][9])) != AvtoModification[tunecar][9])

                            {

                                AddVehicleComponent(tunecar,AvtoModification[tunecar][9]);

                            }

                    }

                        if(AvtoModification[tunecar][10] > 0)

                    {

                        ChangeVehiclePaintjob(tunecar,AvtoModification[tunecar][10]);

                    }

                    if(CarInfo[tunecar][cRegistered] == 1)

                    {

                            SetVehicleNumberPlate(tunecar, CarInfo[tunecar][cPlate]);

                }

                else

                {

                            SetVehicleNumberPlate(tunecar, CarInfo[tunecar][cPlate]);

                }

return 1;

  }

}

        }[/pawn]

daca nu merge schimba sistemul.

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

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.