SA-MP Forums Archive
Error 001: Expected token "]" but found "-identifier-" - 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: Error 001: Expected token "]" but found "-identifier-" (/showthread.php?tid=542555)



Error 001: Expected token "]" but found "-identifier-" - bgedition - 20.10.2014

I have this error:

VehicleSystem.pwn(295) : error 001: expected token: "]", but found "-identifier-"

How can I fix it?

pawn Код:
stock MakeVehicle(playerid, vehModel, vehColor1, vehColor2, vehFuelType[20], vehOwner) {
    new Float:X, Float:Y, Float:Z, Float:angle, model[32];
    if(IsNumeric(model)) vehModel = strval(model);
    else vehModel = GetVehicleModelIDFromName(model);
    if(vehModel < 400 || vehModel > 611) return SendClientMessage(playerid, COLOR_RED, "Invalid model ID!");
    if(vehColor1 < 0 || vehColor2 < 0) return SendClientMessage(playerid, COLOR_RED, "Invalid color!");
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, angle);
    for(new i = 1; i < MAX_SVEHICLES; i++) {
        VehicleInfo[i][vName] = "No name It is for sale";
        VehicleInfo[i][vOwner] = GetName(vehOwner);
        VehicleInfo[i][vModel] = vehModel;
        VehicleInfo[i][vColor][0] = vehColor1;
        VehicleInfo[i][vColor][1] = vehColor2;
        VehicleInfo[i][vPos][0] = X;
        VehicleInfo[i][vPos][1] = Y;
        VehicleInfo[i][vPos][2] = Z;
        VehicleInfo[i][vPos][3] = angle;
        VehicleInfo[i][vInterior] = GetPlayerInterior(playerid);
        VehicleInfo[i][vWorld] = GetPlayerVirtualWorld(playerid);
        VehicleInfo[i][vPrice] = 0;
        VehicleInfo[i][vFuelType] = vehFuelType;
        VehicleInfo[i][vNPlate][10] = DEFAULT_NPLATE;
        for(new d = 0; d < sizeof(VehicleInfo[i][vMods]); d++){VehicleInfo[i][Mods][d] = 0;} //295
        VehicleInfo[i][vFuel] = 100;
        VehicleInfo[i][vDamage] = 1000;
        VehicleInfo[i][vPaintJob] = 255;
        VehicleInfo[i][vLock] = 0;
        VehicleInfo[i][vAlarm] = 0;
        vCreated[i] = true;
        SaveVehicle(i);
    }
    return 1;
}
Pleace Help me!!

Thanks advice.


Re: Error 001: Expected token "]" but found "-identifier-" - Glossy42O - 20.10.2014

It doesn't give errors to me..


Re: Error 001: Expected token "]" but found "-identifier-" - sagoza - 20.10.2014

Neither does to me, it compiled fine... Must be something external, or some piece of info that you are not showing


Re: Error 001: Expected token "]" but found "-identifier-" - Rudy_ - 20.10.2014

A stock gives warnings only when it's used.
On topic, i couldn't find anything wrong :/

If you're using anything like this
pawn Код:
MakeVehicle(playerid, vehModel, vehColor1, vehColor2, vehFuelType[20], vehOwner);
change it to
pawn Код:
MakeVehicle(playerid, vehModel, vehColor1, vehColor2, vehFuelType, vehOwner);



Re: Error 001: Expected token "]" but found "-identifier-" - iZN - 20.10.2014

stock MakeVehicle(playerid, vehModel, vehColor1, vehColor2, vehFuelType[20], vehOwner)

Array in a stock?

pawn Код:
stock MakeVehicle(playerid, vehModel, vehColor1, vehColor2, vehFuelType, vehOwner)