Problem
#1

I'm trying to make a vehicle system with Y_INI, but i'm getting an error on loading vehicle pos.

Enum:

pawn Код:
enum vInfo
{
    Float:vLoc[4]
}
LoadVehicleData function:

pawn Код:
function 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]);

    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;
}
The problem is in this line.

pawn Код:
for(new i = 0; i < 4; i++) format(strLoc, sizeof(strLoc), "Loc%d", i), INI_Float(strLoc, VehicleInfo[vehicleID][vLoc][i]);
Basically i'm trying to loop the vehicle position (X, Y, Z, A), but getting:

Quote:

error 029: invalid expression, assumed zero
error 001: expected token: ";", but found "return"
error 017: undefined symbol "i"
fatal error 107: too many error messages on one line

Reply


Messages In This Thread
Problem - by SymonClash - 16.03.2019, 13:59
Re: Problem - by antixgaming - 16.03.2019, 19:07

Forum Jump:


Users browsing this thread: 1 Guest(s)