04.03.2015, 18:42
Hi guys,
I have some problems with my vehicle system it isn't unloading the vehicles I debugged it but I still can't find the problem I will give you the code so you can try to search it too. Thanks
DEBUG Resultats
I have some problems with my vehicle system it isn't unloading the vehicles I debugged it but I still can't find the problem I will give you the code so you can try to search it too. Thanks
PHP код:
stock SaveVehicle(vehid)
{
new uFile[35], string[128];
format(uFile, 35, VEHICLE_PATH, vehid);
new INI:playerFile = INI_Open(uFile);
INI_WriteInt(playerFile, "Model", VehicleInfo[vehid][vModel]);
INI_WriteInt(playerFile, "Color1", VehicleInfo[vehid][vColor1]);
INI_WriteInt(playerFile, "Color2", VehicleInfo[vehid][vColor2]);
INI_WriteInt(playerFile, "Paintjob", VehicleInfo[vehid][vPaintjob]);
INI_WriteFloat(playerFile, "PosX", VehicleInfo[vehid][vPosX]);
INI_WriteFloat(playerFile, "PosY", VehicleInfo[vehid][vPosY]);
INI_WriteFloat(playerFile, "PosZ", VehicleInfo[vehid][vPosZ]);
INI_WriteFloat(playerFile, "PosA", VehicleInfo[vehid][vPosA]);
INI_WriteFloat(playerFile, "SavePosX", VehicleInfo[vehid][vSavePosX]);
INI_WriteFloat(playerFile, "SavePosY", VehicleInfo[vehid][vSavePosY]);
INI_WriteFloat(playerFile, "SavePosZ", VehicleInfo[vehid][vSavePosZ]);
INI_WriteFloat(playerFile, "SavePosA", VehicleInfo[vehid][vSavePosA]);
INI_WriteInt(playerFile, "ID", VehicleInfo[vehid][vID]);
INI_WriteInt(playerFile, "Price", VehicleInfo[vehid][vPrice]);
INI_WriteInt(playerFile, "Buyable", VehicleInfo[vehid][vBuyable]);
INI_WriteInt(playerFile, "Temp", VehicleInfo[vehid][vTemp]);
INI_WriteString(playerFile, "Owner", VehicleInfo[vehid][vOwner]);
for(new i = 0; i < 16; i++)
{
format(string, sizeof(string), "Mods%d", i);
INI_WriteInt(playerFile, string, VehicleInfo[vehid][vMods][i]);
}
INI_Close(playerFile);
return 1;
}
stock UnloadPlayerVehicles(playerid)
{
for(new i = 0; i < MAX_DYNAMIC_CARS; i++)
{
if(VehicleInfo[i][vID] != INVALID_VEHICLE_ID)
{
print("Unloaded part 1");
if(strcmp(VehicleInfo[i][vOwner], PlayerName(playerid)) == 0)
{
print("strcmp correct");
SaveVehicle(VehicleInfo[i][vID]);
print("SaveVehicle");
DestroyVehicle(VehicleInfo[i][vID]);
print("DestroyVehicle");
VehicleInfo[i][vID] = INVALID_VEHICLE_ID;
print("vID = Invalid ID");
}
printf("UnloadPlayerVehicles: playerid = %d, vID = %d, Owner = %s", playerid, VehicleInfo[i][vID], VehicleInfo[i][vOwner]);
}
}
}
Код:
[21:12:07] FeRRum[Scripter] [ID:0]: /createveh 0 522 0 0 [21:12:07] AdmCmd: FeRRum[Scripter] направи кола на FeRRum[Scripter]. Модел: 522 [21:12:16] Unloaded part 1 [21:12:16] strcmp correct [21:12:16] [part] FeRRum[Scripter] has left the server (0:1)