xstyle
Компетентный
Короче сделал систему машин с сохранением данных о каре в папку auto.cfg . Я покупаю кар, он записывает данные, а к примеру когда я выхожу из кара ( я сделал, чтобы он сохранял позицию, тюнинг кара и т.д ), но он просто в файле auto.cfg всё на 0 ставит. Как исправить? Вот строчки из паблика ( public OnPlayerExitedMenu (playerid) )
Вот само сохранение:
Help me
Вот само сохранение:
PHP:
if(vehicleid == PlayerInfo[playerid][pVehKey])
{
TogglePlayerControllable(playerid, 1);
new Float:xcar, Float:ycar, Float:zcar, Float:ancar;
GetVehicleZAngle(vehicleid, ancar);
GetVehiclePos(vehicleid,xcar,ycar,zcar);
AutoInfo[vehicleid][aAutoX] = xcar;
AutoInfo[vehicleid][aAutoY] = ycar;
AutoInfo[vehicleid][aAutoZ] = zcar;
AutoInfo[vehicleid][aAutoAngle] = ancar;
if(AutoInfo[vehicleid][a0] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a0]);
if(AutoInfo[vehicleid][a1] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a1]);
if(AutoInfo[vehicleid][a2] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a2]);
if(AutoInfo[vehicleid][a3] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a3]);
if(AutoInfo[vehicleid][a4] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a4]);
if(AutoInfo[vehicleid][a5] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a5]);
if(AutoInfo[vehicleid][a6] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a6]);
if(AutoInfo[vehicleid][a7] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a7]);
if(AutoInfo[vehicleid][a8] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a8]);
if(AutoInfo[vehicleid][a9] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a9]);
if(AutoInfo[vehicleid][a10] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a10]);
if(AutoInfo[vehicleid][a11] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a11]);
if(AutoInfo[vehicleid][a12] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a12]);
if(AutoInfo[vehicleid][a13] != 0) AddVehicleComponent(vehicleid, AutoInfo[vehicleid][a13]);
if(AutoInfo[vehicleid][aPaintJob] != 0) ChangeVehiclePaintjob(vehicleid,AutoInfo[vehicleid][aPaintJob]);
SaveAuto();
}
return true;
}
Последнее редактирование:
