OnVehicleSirenStateChange for specific vehicles
#1

Is it possible? or I should've to do it manually through the script via AddStaticVehicle?

Quote:

public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
{
new siren = GetVehicleParamsSirenState(vehicleid);
if(siren == 1)
{
static
Float:fSize[3],
Float:fSeat[3];

GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, fSize[0], fSize[1], fSize[2]); // need height (z)
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_FRONTSEAT, fSeat[0], fSeat[1], fSeat[2]); // need pos (x, y)

CoreVehicles[vehicleid][vehSirenOn] = 1;
CoreVehicles[vehicleid][vehSirenObject] = CreateDynamicObject(18646, 0.0, 0.0, 1000.0, 0.0, 0.0, 0.0);

AttachDynamicObjectToVehicle(CoreVehicles[vehicleid][vehSirenObject], vehicleid, -fSeat[0], fSeat[1], fSize[2] / 2.0, 0.0, 0.0, 0.0);
InfoBoxForPlayer(playerid, "~w~Siren lights: ~g~ ON");
}
else
{
CoreVehicles[vehicleid][vehSirenOn] = 0;
DestroyDynamicObject(CoreVehicles[vehicleid][vehSirenObject]);
InfoBoxForPlayer(playerid, "~w~Siren lights: ~r~ OFF");
}
return 1;
}
That's my code above but it turns to any vehicle that has a siren, is it possible to strict it only to cheetah, sultan or premier?
Reply
#2

pawn Код:
public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
{
    switch (GetVehicleModel(vehicleid))
    {
        case 415, 426, 560:
        {
            // code..
        }
    }
    return 1;
}
If the model of the vehicle is one of those three, do some stuff.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)