loading vehicles from loop
#1

I like to load vehicles with a loop, ingame it works, but i got too much warnings..

over main (didn't post all vehicles, too much xD):
pawn Код:
new Float:VehiclePositions[2][7] =
{
    {520,-181.9419,2666.8167,64.2911,89.6785,0,0}, // hydra ::: LINE 881
    {425,-308.6411,2681.2947,63.8339,270.5902,43,0}, // hunter ::: LINE 882
};
ongamemodeinit:

pawn Код:
for(new id; id < sizeof(VehiclePositions); id++)
    {
        AddStaticVehicle(VehiclePositions[id][0],VehiclePositions[id][1],VehiclePositions[id][2],VehiclePositions[id][3],VehiclePositions[id][4],VehiclePositions[id][5],VehiclePositions[id][6]);
    }
warnings:

(881) : warning 213: tag mismatch
(881) : warning 213: tag mismatch
(881) : warning 213: tag mismatch
(882) : warning 213: tag mismatch
(882) : warning 213: tag mismatch
(882) : warning 213: tag mismatch
Reply
#2

Because you are using integers in a Float variable. (the colors of the vehicle)

See this way, it should work:
pawn Код:
enum vehicleInfo
{
    vModel,
    Float: vPosX,
    Float: vPosY,
    Float: vPosZ,
    Float: vAngle,
    vColor1,
    vColor2
}

new Float: VehiclePositions[][vehicleInfo] =
{
    {520,-181.9419,2666.8167,64.2911,89.6785,0,0}, // hydra ::: LINE 881
    {425,-308.6411,2681.2947,63.8339,270.5902,43,0} // hunter ::: LINE 882
};
pawn Код:
for(new i; i < sizeof(VehiclePositions); i++)
{
    AddStaticVehicle(VehiclePositions[i][vModel], VehiclePositions[i][vPosX], VehiclePositions[i][vPosY], VehiclePositions[i][vPosZ], VehiclePositions[i][vAngle], VehiclePositions[i][vColor1], VehiclePositions[i][vColor2]);
}
Reply
#3

teşekkьrler kardeşim (thanks my brother)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)