/siren
#1

I was wondering how I could make a /siren command for sultan bullet and cheetah. I would like the sultan to have the light bar and the rest to have the siren how could I go about doing this?
Reply
#2

You can create your own co-ordinates & so for each car with this:

https://sampforum.blast.hk/showthread.php?tid=272552
Reply
#3

How would I use those to create a command that only works on the cars I listed?
Reply
#4

Make different CMDs

/sultansiren
/bulletsiren
/cheetahsiren

Or something similar.
Reply
#5

Is there any way to go if vehicle = or something like that? also With my siren command I get
Код HTML:
C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(350) : error 036: empty statement
C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(356) : error 017: undefined symbol "myobject"
Here is the code
Код HTML:
   	new myobject = CreateObject(18646,0,0,-1000,0,0,0,100);
	AttachObjectToVehicle(myobject, GetPlayerVehicleID(playerid),    0.449999,0.000000,0.599999,0.000000,0.000000,0.000000);;
	return 1;
Reply
#6

Quote:
Originally Posted by lramos15
Посмотреть сообщение
Is there any way to go if vehicle = or something like that? also With my siren command I get
Код HTML:
C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(350) : error 036: empty statement
C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(356) : error 017: undefined symbol "myobject"
Here is the code
Код HTML:
   	new myobject = CreateObject(18646,0,0,-1000,0,0,0,100);
	AttachObjectToVehicle(myobject, GetPlayerVehicleID(playerid),    0.449999,0.000000,0.599999,0.000000,0.000000,0.000000);;
	return 1;
add

new myobject;
Reply
#7

I did that and it works but now my siren off command doesn't also is there a way to make it so you just type /siren again and it turns off here is the siren and siren off command
Код HTML:
// Siren
new myobject;
CMD:siren(playerid, params[])
{
    myobject = CreateObject(18646,0,0,-1000,0,0,0,100);
	AttachObjectToVehicle(myobject, GetPlayerVehicleID(playerid), 0.449999,0.000000,0.599999,0.000000,0.000000,0.000000);
	return 1;
}
//siren off
CMD:sirenoff(playerid, params[])
{
	DestroyPlayerObject(playerid, myobject);
    return 1;
}
Reply
#8

PHP код:
CMD:siren(playeridparams[])
{
    if(!
IsValidObject(myobject))
    {
        
myobject CreateObject(18646,0,0,-1000,0,0,0,100);
        
AttachObjectToVehicle(myobjectGetPlayerVehicleID(playerid), 0.449999,0.000000,0.599999,0.000000,0.000000,0.000000);
    }
    else
    {
        
DestroyObject(myobject);
    }
    return 
1;

Reply
#9

Now how do I get it to work on only certain vehicles but not on others?
Reply
#10

pawn Код:
CMD:siren(playerid, params[])
{
    if(!IsValidObject(myobject) && GetVehicleModel(GetPlayerVehicleID(playerid)) == yourid)
    {
        myobject = CreateObject(18646,0,0,-1000,0,0,0,100);
        AttachObjectToVehicle(myobject, GetPlayerVehicleID(playerid), 0.449999,0.000000,0.599999,0.000000,0.000000,0.000000);
    }
    else
    {
        DestroyObject(myobject);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)