function RespawnVehicle© { if(IsAnOwnableCar©) { SetVehicleToRespawn©; SetVehiclePos(c, CarInfo[c][cLocationx],CarInfo[c][cLocationy],CarInfo[c][cLocationz]); SetVehicleZAngle(c, CarInfo[c][cAngle]); SetVehicleInterior(c, CarInfo[c][cInt]); SetVehicleVirtualWorld(c, CarInfo[c][cVirWorld]); SetVehicleParamsEx(c ,0,0,0,CarInfo[c][cLock],0,0,0); engineOn[c] = false; ChangeVehicleColor(c, CarInfo[c][cColorOne], CarInfo[c][cColorTwo]); Gas[c] = 100; } else { SetVehicleToRespawn©; SetVehicleParamsEx(c ,0,0,0,0,0,0,0); engineOn[c] = false; Gas[c] = 100; } }
RespawnVehicle(GetPlayerVehicleID(PlayerInfo[playerid][pPcarkey]));
RespawnVehicle(PlayerInfo[playerid][pPcarkey]);
pawn Код:
|
RespawnVehicle(PlayerInfo[playerid][pPcarkey]);
Entonces si, ponlo asн:
pawn Код:
|
Si exactamente eso quiero, pero no funcionу
![]() |
Si exactamente eso quiero, pero no funcionу
![]() |
Entonces la variable PlayerInfo[playerid][pPcarkey] no estб biйn definida o es 0
|
else if(strcmp(params[0],"vender",true) == 0) { if(IsAtDealership(playerid)) { if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { if(PlayerInfo[playerid][pPcarkey] == 9999) return Message(playerid, COLOR_GRAD2,"ЎNo tienes vehнculo!"); new ownvehkey; if(idcar == PlayerInfo[playerid][pPcarkey]) ownvehkey = PlayerInfo[playerid][pPcarkey]; else return Message(playerid, COLOR_GRAD2,"ЎNo estбs en tu vehнculo!"); if(strcmp(PlayerName(playerid), CarInfo[ownvehkey][cOwner], true) == 0) { new carsellprice = CarInfo[ownvehkey][cValue] / 4 * 3; CarInfo[ownvehkey][cOwned] = 0; strmid(CarInfo[ownvehkey][cOwner], "Concesionario", 0, strlen("Concesionario"), 999); strmid(CarInfo[ownvehkey][cName], GetVehicleFriendlyName(ownvehkey), 0, strlen(GetVehicleFriendlyName(ownvehkey)), 999); strmid(CarInfo[ownvehkey][cPlate], "For Sale", 0, strlen("For Sale"), 9999); SetVehicleNumberPlate(ownvehkey,CarInfo[ownvehkey][cPlate]); Earn(playerid, carsellprice); format(string, sizeof(string), "* Has vendido tu vehнculo por %d$", carsellprice); Message(playerid, COLOR_GREEN, string); GetVehiclePos(ownvehkey, x, y, z); GetVehicleZAngle(ownvehkey, a); CarInfo[ownvehkey][cLocationx] = x; CarInfo[ownvehkey][cLocationy] = y; CarInfo[ownvehkey][cLocationz] = z; CarInfo[ownvehkey][cAngle] = a; CarInfo[ownvehkey][cBattery] = 0; CarInfo[ownvehkey][cGas] = 0; CarInfo[ownvehkey][cAlarm] = 0; CarInfo[ownvehkey][cVehTime] = 1999999999; CarInfo[ownvehkey][cLock] = 0; CarInfo[ownvehkey][cSpoiler] = 0; CarInfo[ownvehkey][cHood] = 0; CarInfo[ownvehkey][cRoof] = 0; CarInfo[ownvehkey][cSideskirt] = 0; CarInfo[ownvehkey][cNitro] = 0; CarInfo[ownvehkey][cLamps] = 0; CarInfo[ownvehkey][cExhaust] = 0; CarInfo[ownvehkey][cWheel] = 0; CarInfo[ownvehkey][cHydraulics] = 0; CarInfo[ownvehkey][cPaintjob] = 0; CarInfo[ownvehkey][cFrontBumper] = 0; CarInfo[ownvehkey][cVents] = 0; CarInfo[ownvehkey][cEmbargo] = 0; CarInfo[ownvehkey][cMulta] = 0; CarInfo[ownvehkey][cGPS] = 0; CarInfo[ownvehkey][cInt] = 0; CarInfo[ownvehkey][cVirWorld] = 0; PlayerInfo[playerid][pPcarkey] = 9999; PlayerInfo[playerid][pTimeCar] = 0; RemovePlayerFromVehicle(playerid); RespawnVehicle(idcar); // aqui esta la funciуn que hace respawnear el auto TogglePlayerControllable(playerid, 1); UpdateCars(); return 1; } else return Message(playerid, COLOR_GRAD2,"Este vehнculo no estб a tu nombre!"); } else return Message(playerid, COLOR_GREY, " Usted tiene que sentarse en su propio coche para venderlo! "); } else return Message(playerid, COLOR_GREY, "ЎNo estбs en un concesionario!"); }