Detaching obj from vehicle
#1

Uhm so I made this command that attaches an siren to Turismo, but how to detach it? What's the function for it?
I tried using DestroyObject but then it wont add the siren on the car after it

AttachObjectToVehicle(TurismoSiren, vehicle, -0.04, -0.54, 0.59, 0.00, 0.00, 0.00);
Reply
#2

You need to destroy and re-create it at a default or chosen position
Reply
#3

How do I do that?


pawn Код:
CMD:siren(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new vehicle;
        vehicle = GetPlayerVehicleID(playerid);
        AttachObjectToVehicle(TurismoSiren, vehicle, -0.04, -0.54, 0.59,   0.00, 0.00, 0.00);
        return 1;
    }
    return 1;
}


CMD:sirenoff(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        DestroyObject(TurismoSiren);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: