SA-MP Forums Archive
errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: errors (/showthread.php?tid=491507)



errors - nickstar - 31.01.2014

Here is the error code

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

Код:
     forward public LoadVehicleData(vehicleID, name[], value[]);
     public LoadVehicleData(vehicleID, name[], value[]) 
     {
         new strLoc[8];
         INI_Int("model", VehicleInfo[vehicleID][vModel]);
1857 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;
     }



Re: errors - MP2 - 31.01.2014

Use a compound block/statement like you should:

pawn Код:
forward public LoadVehicleData(vehicleID, name[], value[]);
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]);
    }
    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;
    }