new TestCar;
TestCar = AddStaticVehicle();
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(//what here?)
{
SendClientMessage(playerid, COLOR_RED,"You are in test car"); }
return 1;
}
When adding a vehicle using:
pawn Код:
[pawn] public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(//what here?) { SendClientMessage(playerid, COLOR_RED,"You are in test car"); } return 1; }[PAWN] |
new TestCar;
TestCar = AddStaticVehicle();
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerInVehicle)
{
SendClientMessage(playerid, COLOR_RED,"You are in test car");
}
return 1;
}
}
if(IsPlayerInVehicle(playerid, TestCar))
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;