Problem with LoadVehicle(filename[256]);
#1

i have problem on this line

pawn Код:
LoadVehicle(filename[256])
{
    CreateVehicleEx(dini_Int(filename, "Model"), dini_Float(filename, "XSpawn"), dini_Float(filename, "YSpawn"), dini_Float(filename, "ZSpawn"), dini_Float(filename, "AngSpawn"), dini_Int(filename, "Col1"), dini_Int(filename, "Col2"), dini_Int(filename, "Respawn"), dini_Get(filename, "Owner")); //i get error when i add dini_Get
}
the error is

Код:
array sizes do not match, or destination array is too small
how to fix it?
Reply
#2

Bump.
Reply
#3

pawn Код:
LoadVehicle(filename[256])
{
CreateVehicleEx(dini_Int(filename, "Model"), dini_Float(filename, "XSpawn"), dini_Float(filename, "YSpawn"), dini_Float(filename, "ZSpawn"), dini_Float(filename, "AngSpawn"), dini_Int(filename, "Col1"), dini_Int(filename, "Col2"), dini_Int(filename, "Respawn"), dini_Get(filename, "Owner")); //i get error when i add dini_Get
}
Nobody will be able to help you if you do not tell us what the damn "CreateVehicleEx" is. It is OBVIOUSLY not from the standard includes.
Reply
#4

pawn Код:
LoadVehicle(filename[ ])
{
    CreateVehicleEx(dini_Int(filename, "Model"), dini_Float(filename, "XSpawn"), dini_Float(filename, "YSpawn"), dini_Float(filename, "ZSpawn"), dini_Float(filename, "AngSpawn"), dini_Int(filename, "Col1"), dini_Int(filename, "Col2"), dini_Int(filename, "Respawn"), dini_Get(filename, "Owner")); //i get error when i add dini_Get
}
Reply
#5

pawn Код:
CreateVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawntime, ownername[MAX_PLAYER_NAME])
{
    new carid = GetFreeVehicleSlot();
    carData[carid][model] = modelid;
    carData[carid][xspawn] = x;
    carData[carid][yspawn] = y;
    carData[carid][zspawn] = z;
    carData[carid][anglespawn] = angle;
    carData[carid][col1] = color1;
    carData[carid][col2] = color2;
    carData[carid][respawn] = respawntime;
    carData[carid][owner] = ownername;
    validcar[carid] = true;
    CreateVehicle(modelid, x, y, z, angle, color1, color2, respawntime);
    return carid;
}
EDIT:

aRoch

it didn't fix it.
Reply
#6

pawn Код:
carData[carid][owner] = ownername;
Is that part of an enum? In any case:

pawn Код:
format(carData[carid][owner],MAX_PLAYER_NAME,"%s",dini_Get(filename,"Owner"));
Reply
#7

pawn Код:
LoadVehicle(filename[256])
{
    new ownername[MAX_PLAYER_NAME];
    strmid(ownername, dini_Get(filename, "Owner"), 0, sizeof(ownername));
    CreateVehicleEx(dini_Int(filename, "Model"), dini_Float(filename, "XSpawn"), dini_Float(filename, "YSpawn"), dini_Float(filename, "ZSpawn"), dini_Float(filename, "AngSpawn"), dini_Int(filename, "Col1"), dini_Int(filename, "Col2"), dini_Int(filename, "Respawn"), ownername);
}
Reply
#8

Cannot rep you anymore...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)