Vehicle error code
#1

pawn Код:
(4647) : error 017: undefined symbol "i"
(4653) : error 017: undefined symbol "INI_Int"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Line:
4647:
pawn Код:
for(new i = 0; i < 4; i++)  format(strLoc, sizeof(strLoc), "Loc%d", i); INI_Float(strLoc, VehicleInfo[vehicleID][vLoc][i]);
4653:
pawn Код:
VehicleInfo[vehicleID][vLocked] = INI_Int("locked") == 1 ? true : false;
pawn Код:
forward public LoadVehicleData(vehicleID, name[], value[]);
public LoadVehicleData(vehicleID, name[], value[]) // This a callback with the parameter of the vehicleID send from our VehicleLoad function. This function will pretty much parse the data from the file.
{
    new strLoc[8]; // Will hold the location key name dynamically.
    // The first argument is the key and the second argument is the data which will hold the value of that key.
    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]);
    // Looping through our location data and retrive it. Loc0 = LocX, Loc1 = LocY, Loc2 = LocZ, Loc3 = LocA.
    INI_Int("color1", VehicleInfo[vehicleID][vColor1]); // You should've guessed it by now.
    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;
    //Converting the locked data from int(whole number) to bool(true/false) and assign it.

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)