17.04.2016, 15:20
(
Последний раз редактировалось iKevin; 17.04.2016 в 16:37.
)
Hi,
I am using dini saving system on my roleplay server, but I am getting a weird error. Player cars arent loading, for example, I buy a car ingame, then I log out and log back in, my car displays in my /stats as None, but it's not deleted, it's just bugged.
Server prints this in the server_log.txt
And my SavePlayerCars;
Any idea, what's wrong? Tell me what do I have to post here to help you help me fix the issue.
~Kevin
Thanks in advance
I am using dini saving system on my roleplay server, but I am getting a weird error. Player cars arent loading, for example, I buy a car ingame, then I log out and log back in, my car displays in my /stats as None, but it's not deleted, it's just bugged.
Код:
. [11:33:50] SavePlayerCars(1) > Car 0 couldn't open file (ID: 1)
And my SavePlayerCars;
Код:
tock SavePlayerCars(playerid, bool:destroy) { for(new slot = 0; slot < 2; slot++) { if(PlayerInfo[playerid][pCarID][slot] > 0) { if(IsValidVehicle(PlayerCars[playerid][slot][c_ID])) { GetVehiclePos(PlayerCars[playerid][slot][c_ID], PlayerCars[playerid][slot][c_LastPos][0], PlayerCars[playerid][slot][c_LastPos][1], PlayerCars[playerid][slot][c_LastPos][2]); GetVehicleZAngle(PlayerCars[playerid][slot][c_ID], PlayerCars[playerid][slot][c_LastPos][3]); for(new comp = 0; comp < 14; comp++) PlayerCars[playerid][slot][c_Component][comp] = GetVehicleComponentInSlot(PlayerCars[playerid][slot][c_ID], comp); PlayerCars[playerid][slot][c_VW] = GetVehicleVirtualWorld(PlayerCars[playerid][slot][c_ID]); PlayerCars[playerid][slot][c_Trunk] = TrunkInfo[PlayerCars[playerid][slot][c_ID]][cTrunkOpened]; PlayerCars[playerid][slot][c_Gun][0] = TrunkInfo[PlayerCars[playerid][slot][c_ID]][cGun1]; PlayerCars[playerid][slot][c_Gun][1] = TrunkInfo[PlayerCars[playerid][slot][c_ID]][cGun2]; PlayerCars[playerid][slot][c_Pot] = TrunkInfo[PlayerCars[playerid][slot][c_ID]][cPot]; PlayerCars[playerid][slot][c_Crack] = TrunkInfo[PlayerCars[playerid][slot][c_ID]][cCrack]; PlayerCars[playerid][slot][c_Armor] = TrunkInfo[PlayerCars[playerid][slot][c_ID]][cArmor]; } new strFile[48]; format(strFile, sizeof(strFile), "cars/%d.ini", PlayerInfo[playerid][pCarID][slot]); new File:fCar = fopen(strFile, io_write); if(!fCar) return printf("SavePlayerCars(%d) > Car %d couldn't open file (ID: %d)", playerid, slot, PlayerInfo[playerid][pCarID][slot]); new strData[64]; format(strData, sizeof(strData), "Model=%d\n", PlayerCars[playerid][slot][c_Model]); fwrite(fCar, strData); format(strData, sizeof(strData), "X=%f\n", PlayerCars[playerid][slot][c_ParkPos][0]); fwrite(fCar, strData); format(strData, sizeof(strData), "Y=%f\n", PlayerCars[playerid][slot][c_ParkPos][1]); fwrite(fCar, strData); format(strData, sizeof(strData), "Z=%f\n", PlayerCars[playerid][slot][c_ParkPos][2]); fwrite(fCar, strData); format(strData, sizeof(strData), "A=%f\n", PlayerCars[playerid][slot][c_ParkPos][3]); fwrite(fCar, strData); format(strData, sizeof(strData), "LX=%f\n", PlayerCars[playerid][slot][c_LastPos][0]); fwrite(fCar, strData); format(strData, sizeof(strData), "LY=%f\n", PlayerCars[playerid][slot][c_LastPos][1]); fwrite(fCar, strData); format(strData, sizeof(strData), "LZ=%f\n", PlayerCars[playerid][slot][c_LastPos][2]); fwrite(fCar, strData); format(strData, sizeof(strData), "LA=%f\n", PlayerCars[playerid][slot][c_LastPos][3]); fwrite(fCar, strData); format(strData, sizeof(strData), "C1=%d\n", PlayerCars[playerid][slot][c_Color][0]); fwrite(fCar, strData); format(strData, sizeof(strData), "C2=%d\n", PlayerCars[playerid][slot][c_Color][1]); fwrite(fCar, strData); format(strData, sizeof(strData), "PJ=%d\n", PlayerCars[playerid][slot][c_PaintJob]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp0=%d\n", PlayerCars[playerid][slot][c_Component][0]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp1=%d\n", PlayerCars[playerid][slot][c_Component][1]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp2=%d\n", PlayerCars[playerid][slot][c_Component][2]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp3=%d\n", PlayerCars[playerid][slot][c_Component][3]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp4=%d\n", PlayerCars[playerid][slot][c_Component][4]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp5=%d\n", PlayerCars[playerid][slot][c_Component][5]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp6=%d\n", PlayerCars[playerid][slot][c_Component][6]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp7=%d\n", PlayerCars[playerid][slot][c_Component][7]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp8=%d\n", PlayerCars[playerid][slot][c_Component][8]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp9=%d\n", PlayerCars[playerid][slot][c_Component][9]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp10=%d\n", PlayerCars[playerid][slot][c_Component][10]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp11=%d\n", PlayerCars[playerid][slot][c_Component][11]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp12=%d\n", PlayerCars[playerid][slot][c_Component][12]); fwrite(fCar, strData); format(strData, sizeof(strData), "comp13=%d\n", PlayerCars[playerid][slot][c_Component][13]); fwrite(fCar, strData); format(strData, sizeof(strData), "alarm=%d\n", PlayerCars[playerid][slot][c_Alarm]); fwrite(fCar, strData); format(strData, sizeof(strData), "ins=%d\n", PlayerCars[playerid][slot][c_Insurance]); fwrite(fCar, strData); format(strData, sizeof(strData), "plate=%s\n", PlayerCars[playerid][slot][c_Plate]); fwrite(fCar, strData); format(strData, sizeof(strData), "gps=%d\n", PlayerCars[playerid][slot][c_GPS]); fwrite(fCar, strData); format(strData, sizeof(strData), "tow=%d\n", PlayerCars[playerid][slot][c_Tow]); fwrite(fCar, strData); format(strData, sizeof(strData), "keys=%d\n", PlayerCars[playerid][slot][c_Keys]); fwrite(fCar, strData); format(strData, sizeof(strData), "lock=%d\n", PlayerCars[playerid][slot][c_Lock]); fwrite(fCar, strData); format(strData, sizeof(strData), "price=%d\n", PlayerCars[playerid][slot][c_Price]); fwrite(fCar, strData); format(strData, sizeof(strData), "virtualworld=%d\n", PlayerCars[playerid][slot][c_VW]); fwrite(fCar, strData); format(strData, sizeof(strData), "trunk_opened=%d\n", PlayerCars[playerid][slot][c_Trunk]); fwrite(fCar, strData); format(strData, sizeof(strData), "trunk_gun1=%d\n", PlayerCars[playerid][slot][c_Gun][0]); fwrite(fCar, strData); format(strData, sizeof(strData), "trunk_gun2=%d\n", PlayerCars[playerid][slot][c_Gun][1]); fwrite(fCar, strData); format(strData, sizeof(strData), "trunk_pot=%d\n", PlayerCars[playerid][slot][c_Pot]); fwrite(fCar, strData); format(strData, sizeof(strData), "trunk_crack=%d\n", PlayerCars[playerid][slot][c_Crack]); fwrite(fCar, strData); format(strData, sizeof(strData), "trunk_armor=%f\n", PlayerCars[playerid][slot][c_Armor]); fwrite(fCar, strData); format(strData, sizeof(strData), "impounded=%d\n", PlayerCars[playerid][slot][c_Impounded]); fwrite(fCar, strData); fclose(fCar); if(destroy) { DestroyVehicle(PlayerCars[playerid][slot][c_ID]); PlayerCars[playerid][slot][c_ID] = 0; } } } return 1; }
~Kevin
Thanks in advance