Adding vehicle
#1

When adding a vehicle using:
pawn Код:
new TestCar;

TestCar = AddStaticVehicle();
Then when you enter vehicle how can I check if its TestCar i entered? Is there a way to do that?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(//what here?)
           {
           SendClientMessage(playerid, COLOR_RED,"You are in test car"); }
    return 1;

}
BTW: test car is loaded from file, so there could be 10 vehicles added that are TestCar
Reply
#2

Quote:
Originally Posted by HondaCBR
Посмотреть сообщение
When adding a vehicle using:
pawn Код:
new TestCar;

TestCar = AddStaticVehicle();
Then when you enter vehicle how can I check if its TestCar i entered? Is there a way to do that?

[pawn]
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(//what here?)
{
SendClientMessage(playerid, COLOR_RED,"You are in test car"); }
return 1;

}[PAWN]
pawn Код:
new TestCar;

TestCar = AddStaticVehicle();
Then when you enter vehicle how can I check if its TestCar i entered? Is there a way to do that?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsPlayerInVehicle)
           {
           SendClientMessage(playerid, COLOR_RED,"You are in test car");
           }
    return 1;
}

}
Reply
#3

Do you mean?
pawn Код:
if(IsPlayerInVehicle(playerid, TestCar))
Reply
#4

Now: im using this to add cars from file:
pawn Код:
new CarFile[35], count = 0;
    for(new i = 1000; i<1050; i++)
    {
        format(CarFile,sizeof(CarFile),"/Auta/%i.ini", i);
        if(fexist(CarFile))
        {
            if(dini_Int(CarFile,"Owner") == 1)
            {
                CarFrakcja = CreateVehicle(dini_Int(CarFile,"ModelID"),dini_Float(CarFile,"X"),dini_Float(CarFile,"Y"),dini_Float(CarFile,"Z"),dini_Float(CarFile,"A"),dini_Int(CarFile,"Color1"),dini_Int(CarFile,"Color2"),-1);
                ChangeVehiclePaintjob(CarFrakcja,dini_Int(CarFile,"Paintjob"));
                SetVehicleHealth(CarFrakcja,dini_Float(CarFile,"Health"));
                UpdateVehicleDamageStatus(CarFrakcja,dini_Int(CarFile,"Panels"),dini_Int(CarFile,"Doors"),dini_Int(CarFile,"Lights"),dini_Int(CarFile,"Tires"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"SPOILER"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"HOOD"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"ROOF"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"SIDESKIRT"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"LAMPS"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"NITRO"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"EXHAUST"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"WHEELS"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"STEREO"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"HYDRAULICS"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"FRONT_BUMPER"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"REAR_BUMPER"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"VENT_RIGHT"));
                AddVehicleComponent(CarFrakcja,dini_Int(CarFile,"VENT_LEFT"));
                dini_IntSet(CarFile,"Spawned",1);
                count ++;
            }

        }
    }
    printf("Zaladowano: %i aut frakcyjnych", count);
    return 1;
Lets say I have 3 cars, then all 3 are CarFrakcja, how can I change it so that each car has a different name, Eg CarFrakcja[0], CarFrakcja[1] etc
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)