SA-MP Forums Archive
Detaching obj from vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Detaching obj from vehicle (/showthread.php?tid=435563)



Detaching obj from vehicle - Squirrel - 07.05.2013

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);


Re: Detaching obj from vehicle - Pottus - 07.05.2013

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


AW: Detaching obj from vehicle - Squirrel - 07.05.2013

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;
}