SA-MP Forums Archive
Problem with LoadVehicle(filename[256]); - 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: Problem with LoadVehicle(filename[256]); (/showthread.php?tid=354286)



Problem with LoadVehicle(filename[256]); - JaKe Elite - 26.06.2012

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?


Re: Problem with LoadVehicle(filename[256]); - JaKe Elite - 26.06.2012

Bump.


Re: Problem with LoadVehicle(filename[256]); - Grand_Micha - 26.06.2012

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.


Re: Problem with LoadVehicle(filename[256]); - aRoach - 26.06.2012

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
}



Re: Problem with LoadVehicle(filename[256]); - JaKe Elite - 26.06.2012

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.


Re: Problem with LoadVehicle(filename[256]); - Grand_Micha - 26.06.2012

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"));



Re: Problem with LoadVehicle(filename[256]); - MadeMan - 26.06.2012

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);
}



Re: Problem with LoadVehicle(filename[256]); - JaKe Elite - 28.06.2012

Cannot rep you anymore...