Dynamic vehicle system.
#1

Hello, I'm working on a dynamic filterscript. However there is one issue, when I spawn the vehicle it wont assign the correct id to the correct vehicle.
pawn Код:
stock SpawnCars()
{
    for(new ID = 0; ID < sizeof(VehInfo); ID++)
    {
        if(!(VehInfo[ID][VehCreated] == 0))
        {
        new plate[12];
        VEHICL[ID] = CreateVehicle(VehInfo[ID][VehType], VehInfo[ID][VehSpawnX], VehInfo[ID][VehSpawnY], VehInfo[ID][VehSpawnZ], VehInfo[ID][VehZAngle], VehInfo[ID][VehColor1], VehInfo[ID][VehColor2], -1);
        }
    }
    return 1;
}

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
        new string[64];
        format(string, sizeof(string),"you enterd vehicle ID :%d",VEHICL[vehicleid]);
        SCM(playerid, COLOR_GREEN, string);
        return 1;
}
I also have a command to teleport me to a specifyed vehicle and it dosent take me to the correct vehicleID I get when I enter the vehicle
Reply
#2

pawn Код:
stock SpawnCars()
{
    for(new ID = 0; ID < sizeof(VehInfo); ID++)
    {
        if(VehInfo[ID][VehCreated] == 0)
        {
              new plate[12];
              VEHICL[ID] = CreateVehicle(VehInfo[ID][VehType], VehInfo[ID][VehSpawnX], VehInfo[ID][VehSpawnY], VehInfo[ID][VehSpawnZ], VehInfo[ID][VehZAngle], VehInfo[ID][VehColor1], VehInfo[ID][VehColor2], -1);
              VehInfo[ID][VehCreated] = 1;
        }
    }
    return 1;
}
Try this.
Reply
#3

With that it wont spawn any vehicle, VehInfo[ID][VehCreated] is already defined in the database file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)