SA-MP Forums Archive
Siren - 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: Siren (/showthread.php?tid=432683)



Siren - Povis - 23.04.2013

Hello I want to create cause a siren will be added on my HSIU cars like bullet and other... Where is a problem? (I can't see siren now)

This is my Code:

Код:
new
    sirena,
    bool:sirenaU;
 
CMD:sirena(playerid, params[])
{
    if(sirenaU == false)
    {
        sirena = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
        AttachObjectToVehicle(Sirena, 541, 0.0, 0.75, 0.275, 0.0, 0.1, 0.0);
        sirenaU = true;
       
    } else {
        DestroyObject(sirena);
        sirenaU = false;
        }
    return 1;
}
And this is my object (siren) which I add with one filterscript:
Код:
AttachObjectToVehicle(objectid, vehicleid, 0.374999, 0.000000, 0.684999, 0.000000, 0.000000, 0.000000); //Object Model: 18646 |



Re: Siren - DaTa[X] - 23.04.2013

try this
pawn Код:
new
    sirena,
    bool:sirenaU;
 
CMD:sirena(playerid, params[])
{
    if(sirenaU == false)
    {
        sirena = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
        AttachObjectToVehicle(Sirena, GetPlayerVehicleID(playerid), 0.0, 0.75, 0.275, 0.0, 0.1, 0.0);
        sirenaU = true;
       
    } else {
        DestroyObject(sirena);
        sirenaU = false;
        }
    return 1;
}
or try this FS to help your attach objects to your vehicles
https://www.******.tn/url?sa=t&rct=j...45580626,d.ZGU


Re: Siren - Povis - 23.04.2013

Thanks. And how I can make that cause if player is in vehicle just then he can put and destroy that siren. And if he is not in any vehicle he can't destroy and put it?