Vehicle spawning
#1

Why doesn't this work? I'm trying to make a code that will spawn vehicles from the info in scriptfiles folder,(every car has its own .ini by its ID ) i menaged to dini_Create all .inis but why doesnt this work? Any help? Doesnt have to be with a timer... Thanks.
Код:
public SpawnCar(vehicleid)
{
for(new i=0; i < MAX_VEHICLES; i++)
{

new pFile2[100];
format(pFile2, sizeof(pFile2), CARS_PATH,i);
CreateVehicle(dini_Int(pFile2,"Model"),dini_Float(pFile2,"X"),dini_Float(pFile2,"Y"),dini_Float(pFile2,"Z"),dini_Float(pFile2,"A"),2,2,999);
}
    return 1;
}
public OnGameModeInit()
{
SetTimerEx("SpawnCar",1000/*one second */,true,"d",i);

}
Reply
#2

create a stock instead
and use in OnGamemodeinit -> SpawnCar();
and stock
pawn Код:
stock SpawnCar()
{
    for(new i=0; i < MAX_VEHICLES; i++)
    {
        new pFile2[100];
        format(pFile2, sizeof(pFile2), CARS_PATH,i);
        CreateVehicle(dini_Int(pFile2,"Model"),dini_Float(pFile2,"X"),dini_Float(pFile2,"Y"),dini_Float(pFile2,"Z"),dini_Float(pFile2,"A"),2,2,999);
        printf("ID[%i]-> CreateVehicle(%d,%f,%f%,%f,2,2,999);",i,dini_Int(pFile2,"Model"),dini_Float(pFile2,"X"),dini_Float(pFile2,"Y"),dini_Float(pFile2,"Z"),dini_Float(pFile2,"A"));// now debug with this code
    }
    return 1;
}
Reply
#3

Much appreciated ++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)