Vehicle system problems..(y_ini) -
Scrillex - 07.01.2014
Hello everyone.
So I have some problems with this code:
pawn Код:
stock VehicleSave(vehicleID)
{
new INI:dFile = INI_Open(VehiclePath(vehicleID));
new strLoc[8];
INI_WriteInt(dFile, "model", VehicleInfo[vehicleID][vModel]);
for(new i = 0; i < 4; i++)
format(strLoc, sizeof(strLoc), "Loc%d", i),INI_Float(dFile, strLoc, VehicleInfo[vehicleID][vLoc][i]);//THIS IS THE ERROR LINE!
INI_WriteInt(dFile, "color1", VehicleInfo[vehicleID][vColor1]);
INI_WriteInt(dFile, "color2", VehicleInfo[vehicleID][vColor2]);
INI_WriteInt(dFile, "respawn", VehicleInfo[vehicleID][vRespawn]);
INI_WriteString(dFile, "owner", VehicleInfo[vehicleID][vOwner]);
INI_WriteInt(dFile, "locked", VehicleInfo[vehicleID][vLocked] ? 1 : 0);
INI_Close(dFile);
}
Errors:
pawn Код:
error 029: invalid expression, assumed zero
error 035: argument type mismatch (argument 1)
error 001: expected token: ";", but found "return"
fatal error 107: too many error messages on one line
Thank you for your time..
With best regards Scrillex.
Re: Vehicle system problems..(y_ini) -
ikey07 - 07.01.2014
try to change this
INI_WriteInt(dFile, "locked", VehicleInfo[vehicleID][vLocked] ? 1 : 0);
to
INI_WriteInt(dFile, "locked", VehicleInfo[vehicleID][vLocked]);
as vLocked is already 0 or 1
Re: Vehicle system problems..(y_ini) -
Scrillex - 07.01.2014
This is the error actual line.. But that you for advice I will change it. Just using bool:vLocked.
pawn Код:
format(strLoc, sizeof(strLoc), "Loc%d", i),INI_Float(dFile, strLoc, VehicleInfo[vehicleID][vLoc][i]);//THIS IS THE ERROR LINE!
Re: Vehicle system problems..(y_ini) -
ikey07 - 07.01.2014
Is this a float stat VehicleInfo[vehicleID][vLoc][i] ?
Re: Vehicle system problems..(y_ini) -
Scrillex - 07.01.2014
Everywhere else it works not only in this peace of code.
Errors:
pawn Код:
error 029: invalid expression, assumed zero
error 017: undefined symbol "i"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Error is on this line only:
pawn Код:
for(new i = 0; i < 4; i++), format(strLoc, sizeof(strLoc), "Loc%d", i),INI_Float(dFile, strLoc, VehicleInfo[vehicleID][vLoc][i]);
Re: Vehicle system problems..(y_ini) -
EiresJason - 07.01.2014
Is this line:
pawn Код:
format(strLoc, sizeof(strLoc), "Loc%d", i),INI_Float(dFile, strLoc, VehicleInfo[vehicleID][vLoc][i]);
suppose to write the float? If so, you forgot the 'Write' part, so it's actually trying to load.
pawn Код:
format(strLoc, sizeof(strLoc), "Loc%d", i),INI_WriteFloat(dFile, strLoc, VehicleInfo[vehicleID][vLoc][i]);//THIS IS THE ERROR LINE!
Re: Vehicle system problems..(y_ini) -
Scrillex - 07.01.2014
LOOL I so failed.
But still the error
pawn Код:
error 029: invalid expression, assumed zero
error 017: undefined symbol "i"
Re: Vehicle system problems..(y_ini) -
EiresJason - 07.01.2014
Does this fix it?
pawn Код:
stock VehicleSave(vehicleID)
{
new INI:dFile = INI_Open(VehiclePath(vehicleID));
new strLoc[8];
INI_WriteInt(dFile, "model", VehicleInfo[vehicleID][vModel]);
for(new i = 0; i < 4; i++) { format(strLoc, sizeof(strLoc), "Loc%d", i); INI_Float(dFile, strLoc, VehicleInfo[vehicleID][vLoc][i]); }
INI_WriteInt(dFile, "color1", VehicleInfo[vehicleID][vColor1]);
INI_WriteInt(dFile, "color2", VehicleInfo[vehicleID][vColor2]);
INI_WriteInt(dFile, "respawn", VehicleInfo[vehicleID][vRespawn]);
INI_WriteString(dFile, "owner", VehicleInfo[vehicleID][vOwner]);
INI_WriteInt(dFile, "locked", VehicleInfo[vehicleID][vLocked] ? 1 : 0);
INI_Close(dFile);
}
Re: Vehicle system problems..(y_ini) -
Scrillex - 07.01.2014
Maybe need to #define MAX_VEHICLES or something..
pawn Код:
error 035: argument type mismatch (argument 1)
error 017: undefined symbol "value"
Re: Vehicle system problems..(y_ini) -
Scrillex - 07.01.2014
Sorry for bump.. but load function is giving the same error...
CODE:
pawn Код:
public LoadVehicleData(vehicleID, name[], value[])
{
new strLoc[8];
INI_Int("model", VehicleInfo[vehicleID][vModel]);
for(new i = 0; i < 4; i++)
{
format(strLoc, sizeof(strLoc), "Loc%d", i), INI_Float(strLoc, VehicleInfo[vehicleID][vLoc][i]); //This line!
}
INI_Int("color1", VehicleInfo[vehicleID][vColor1]);
INI_Int("color2", VehicleInfo[vehicleID][vColor2]);
INI_Int("respawn", VehicleInfo[vehicleID][vRespawn]);
INI_String("owner", VehicleInfo[vehicleID][vOwner], MAX_PLAYER_NAME);
VehicleInfo[vehicleID][vLocked] = INI_Int("locked") == 1 ? true : false;
return 1;
}
ERROR:
pawn Код:
error 029: invalid expression, assumed zero
error 001: expected token: ";", but found "return"