#1

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 |
Reply
#2

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
Reply
#3

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?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)