Vehicle system error. -
viddo - 06.01.2015
pawn Код:
stock VehicleLoad(vehicleID, file[])//loading the vehicle provided by the id when the server starts.
{
INI_ParseFile(file, "LoadVehicleData", .bExtra = true, .extra = vehicleID);
VehicleCreate(VehicleInfo[vehicleID][vModel],
VehicleInfo[vehicleID][vLoc], VehicleInfo[vehicleID][vColor1], VehicleInfo[vehicleID][vColor2], VehicleInfo[vehicleID][vRespawn],
VehicleInfo[vehicleID][vOwner], VehicleInfo[vehicleID][vLocked]);
}
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);
}
Код:
(228) : error 047: array sizes do not match, or destination array is too small
(238) : error 035: argument type mismatch (argument 1)
(238) : error 017: undefined symbol "value"
The lines:
pawn Код:
VehicleCreate(VehicleInfo[vehicleID][vModel],VehicleInfo[vehicleID][vLoc], VehicleInfo[vehicleID][vColor1], VehicleInfo[vehicleID][vColor2], VehicleInfo[vehicleID][vRespawn],VehicleInfo[vehicleID][vOwner], VehicleInfo[vehicleID][vLocked]);
pawn Код:
for(new i = 0; i < 4; i++) { format(strLoc, sizeof(strLoc), "Loc%d", i); INI_Float(dFile, strLoc, VehicleInfo[vehicleID][vLoc][i]); }
Any ideas?
Re: Vehicle system error. -
Threshold - 06.01.2015
For the first one, you have VehicleInfo[vehicleID][vOwner], which is probably an array size of 24 or MAX_PLAYER_NAME. You need to match that array size in your VehicleCreate function, so I'd need to see that before I can correct it.
As for the second one, you have INI_Float, whereas you should have been using INI_WriteFloat.
Re: Vehicle system error. -
viddo - 06.01.2015
Yeah but both are the same values though O.o
pawn Код:
stock VehicleCreate(vehicleModel, Float:vehicleLoc[4], vehicleColor1, vehicleColor2, vehicleRespawn, vehicleOwner[], bool:vehicleLocked)
{
new vehicleid = VehicleGetFreeSlot();
VehicleInfo[vehicleid][vModel] = vehicleModel;
VehicleInfo[vehicleid][vLoc] = vehicleLoc;
VehicleInfo[vehicleid][vColor1] = vehicleColor1;
VehicleInfo[vehicleid][vColor2] = vehicleColor2;
VehicleInfo[vehicleid][vRespawn] = vehicleRespawn;
format(VehicleInfo[vehicleid][vOwner], MAX_PLAYER_NAME, vehicleOwner);
VehicleInfo[vehicleid][vLocked] = vehicleLocked;
VehicleInfo[vehicleid][vID] = CreateVehicle(vehicleModel, vehicleLoc[0], vehicleLoc[1], vehicleLoc[2], vehicleLoc[3], vehicleColor1, vehicleColor2,vehicleRespawn);
vCreated[vehicleid] = true;
VehicleLock(vehicleid, VehicleInfo[vehicleid][vLocked]);
return vehicleid;
}
Re: Vehicle system error. -
Threshold - 06.01.2015
Change:
to:
pawn Код:
vehicleOwner[MAX_PLAYER_NAME]
Re: Vehicle system error. -
viddo - 06.01.2015
Yeah I tried that but it gives me the same error.
Re: Vehicle system error. -
DRIFT_HUNTER - 06.01.2015
When you call VehicleCreate function you pass single argument for location: VehicleInfo[vehicleID][vLoc]
You need to pass X,Y,Z arguments as floats and separated.
Re: Vehicle system error. -
viddo - 06.01.2015
Alright so I changed into single separated ones and still got the same problem -.-
pawn Код:
VehicleCreate(VehicleInfo[vehicleID][vModel], VehicleInfo[vehicleID][vLocx], VehicleInfo[vehicleID][vLocy], VehicleInfo[vehicleID][vLocz],VehicleInfo[vehicleID][vLocr], VehicleInfo[vehicleID][vColor1], VehicleInfo[vehicleID][vColor2], VehicleInfo[vehicleID][vRespawn],VehicleInfo[vehicleID][vOwner], VehicleInfo[vehicleID][vLocked]);
Re: Vehicle system error. -
Threshold - 07.01.2015
Could you show your enum?
Re: Vehicle system error. -
viddo - 07.01.2015
pawn Код:
enum vInfo
{
vID,
vModel,
Float:vLoc[4],
vColor1,
vColor2,
vRespawn,
vOwner[MAX_PLAYER_NAME],
bool:vLocked
}
Then I changed the vLoc to separate x,y,z and angle but still didn't work.