forward public LoadVehicleData(vehicleID, name[], value[]);
public LoadVehicleData(vehicleID, name[], value[])
{
new location[32];
INI_Int("Model", VehicleInfo[vehicleID][vModel]);
for(new i = 0; i < 4; i++) format(location, sizeof(location), "Loc%d", i), INI_Float(location, VehicleInfo[vehicleID][vLoc][i]);
INI_Int("Color 1", VehicleInfo[vehicleID][vColor1]);
INI_Int("Color 2", VehicleInfo[vehicleID][vColor2]);
INI_String("Owner", VehicleInfo[vehicleID][vOwner], MAX_PLAYER_NAME);
VehicleInfo[vehicleID][vLocked] = INI_Int("Locked") == 1 ? true : false;
return 1;
}
stock VehicleSave(vehicleID)
{
new INI:dFile = INI_Open(VehiclePath(vehicleID))
new location[32];
INI_WriteInt(dFile, "Model", VehicleInfo[vehicleID][vModel]);
for(new i = 0; i < 4; i++) format(loaction, sizeof location, "Location: %i", i), INI_Float(location, VehicleInfo[vehicleID][vLoc][i]);
INI_WriteInt(dFile, "Color 1", VehicleInfo[vehicleID][vColor1]);
INI_WriteInt(dFile, "Color 2", VehicleInfo[vehicleID][vColor2]);
INI_WriteInt(dFile, "Owner", VehicleInfo[vehicleID][vOwner]);
INI_WriteInt(dFile, "Locked", VehicleInfo[vehicleID][vLocked] ? 1 : 0);
INI_Close(dFile);
return 1;
}
The error line of both stocks: PHP код:
error 001: expected token: ";", but found error 017: undefined symbol "i" fatal error 107: too many error messages on one line |
for(new i = 0; i < 4; i++) format(loaction, sizeof location, "Location: %i", i), INI_Float(location, VehicleInfo[vehicleID][vLoc][i]);
for(new i = 0; i < 4; i++) {
format(loaction, sizeof location, "Location: %i", i);
INI_Float(location, VehicleInfo[vehicleID][vLoc][i]);
}
INI_WriteInt(dFile, "Color 1", VehicleInfo[vehicleID][vColor1]);
INI_WriteInt(dFile, "Color 2", VehicleInfo[vehicleID][vColor2]);
INI_WriteInt(dFile, "Owner", VehicleInfo[vehicleID][vOwner]);
INI_WriteInt(dFile, "Locked", VehicleInfo[vehicleID][vLocked] ? 1 : 0);
INI_WriteFloat(dFile, "LocationX", VehicleInfo[vehicleid][vLoc][0]);
INI_WriteFloat(dFile, "LocationY", VehicleInfo[vehicleid][vLoc][1]);
INI_WriteFloat(dFile, "LocationZ", VehicleInfo[vehicleid][vLoc][2]);
INI_WriteFloat(dFile, "LocationA", VehicleInfo[vehicleid][vLoc][3]);
INI_WriteInt(dFile, "Color1", VehicleInfo[vehicleID][vColor1]);
INI_WriteInt(dFile, "Color2", VehicleInfo[vehicleID][vColor2]);
INI_WriteInt(dFile, "Owner", VehicleInfo[vehicleID][vOwner]);
INI_WriteInt(dFile, "Locked", VehicleInfo[vehicleID][vLocked] ? 1 : 0);
Float:vLocX,
Float:vLocY,
Float:vLocZ,
Float:vLocA,
INI_WriteFloat(dFile, "LocationX", VehicleInfo[vehicleid][vLocX]);
INI_WriteFloat(dFile, "LocationY", VehicleInfo[vehicleid][vLocY]);
INI_WriteFloat(dFile, "LocationZ", VehicleInfo[vehicleid][vLocZ]);
INI_WriteFloat(dFile, "LocationA", VehicleInfo[vehicleid][vLocA]);
INI_WriteInt(dFile, "Color1", VehicleInfo[vehicleID][vColor1]);
INI_WriteInt(dFile, "Color2", VehicleInfo[vehicleID][vColor2]);
INI_WriteInt(dFile, "Owner", VehicleInfo[vehicleID][vOwner]);
INI_WriteInt(dFile, "Locked", VehicleInfo[vehicleID][vLocked] ? 1 : 0);
forward public somefunction();
somefunction() {}
forward public LoadVehicleData(vehicleID, name[], value[]);
public LoadVehicleData(vehicleID, name[], value[])
{
new location[32];
INI_Int("Model", VehicleInfo[vehicleID][vModel]);
for(new i = 0; i < 4; i++)
{
format(location, sizeof location, "Location: %i", i);
INI_Float(location, VehicleInfo[vehicleID][vLoc][i]);
}
INI_WriteFloat(dFile, "LocationX", VehicleInfo[vehicleID][vLoc][0]);
INI_WriteFloat(dFile, "LocationY", VehicleInfo[vehicleID][vLoc][1]);
INI_WriteFloat(dFile, "LocationZ", VehicleInfo[vehicleID][vLoc][2]);
INI_Int("Color 1", VehicleInfo[vehicleID][vColor1]);
INI_Int("Color 2", VehicleInfo[vehicleID][vColor2]);
INI_String("Owner", VehicleInfo[vehicleID][vOwner], MAX_PLAYER_NAME);
VehicleInfo[vehicleID][vLocked] = INI_Int("Locked") == 1 ? true : false;
return 1;
}
stock VehicleSave(vehicleID)
{
new INI:dFile = INI_Open(VehiclePath(vehicleID))
new location[32];
INI_WriteInt(dFile, "Model", VehicleInfo[vehicleID][vModel]);
for(new i = 0; i < 4; i++)
{
format(location, sizeof location, "Location: %i", i);
INI_Float(location, VehicleInfo[vehicleID][vLoc][i]);
}
INI_WriteFloat(dFile, "LocationX", VehicleInfo[vehicleID][vLoc][0]);
INI_WriteFloat(dFile, "LocationY", VehicleInfo[vehicleID][vLoc][1]);
INI_WriteFloat(dFile, "LocationZ", VehicleInfo[vehicleID][vLoc][2]);
INI_WriteInt(dFile, "Color 1", VehicleInfo[vehicleID][vColor1]);
INI_WriteInt(dFile, "Color 2", VehicleInfo[vehicleID][vColor2]);
INI_WriteInt(dFile, "Owner", VehicleInfo[vehicleID][vOwner]);
INI_WriteInt(dFile, "Locked", VehicleInfo[vehicleID][vLocked] ? 1 : 0);
INI_Close(dFile);
return 1;
}
forward public SomeFunction();
SomeFunction() { }
VehicleInfo[vehicleID][vLocked] = INI_Int("Locked") == 1 ? true : false;
INI_Int("Locked", VehicleInfo[vehicleID][vLocked]);