#1

їHow do I put the siren of a patrol to a sultan?

Thanks in advance
Reply
#2

Add the addsiren parameter at the end
Код:
CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, addsiren=1)
Reply
#3

PHP код:
CMD:siren(playeridparams[])
{
        if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridANY_COLOR"You aren't inside a vehicle");
        new 
objectid CreateObject(19620000000);
        
AttachObjectToVehicle(objectidGetPlayerVehicleID(playerid), 0.009999, -0.0199990.8549990.0000000.0000000.000000);
          return 
1;

This is a simple command which allows you to attach a siren object without having to create a new vehicle with siren paramater toggled on
Reply
#4

Quote:
Originally Posted by Lucases
Посмотреть сообщение
PHP код:
CMD:siren(playeridparams[])
{
        if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridANY_COLOR"You aren't inside a vehicle");
        new 
objectid CreateObject(19620000000);
        
AttachObjectToVehicle(objectidGetPlayerVehicleID(playerid), 0.009999, -0.0199990.8549990.0000000.0000000.000000);
          return 
1;

This is a simple command which allows you to attach a siren object without having to create a new vehicle with siren paramater toggled on
there's a difference tho between the object and the addsiren parameter, that doesn't add an object it simply adds a siren togged by the H button ( only a sound effect ) but hey your script works it does attach the actual object so he can use that for visual effects.
Reply
#5

I know RogueDrifter, I added a small comment after the code and explained that, thanks anyway


I prefer a command instead of addsiren parameter, because you don't need to recreate the vehicle in order to add a siren, you can do it while you're driving
Reply
#6

Quote:
Originally Posted by Lucases
Посмотреть сообщение
I know RogueDrifter, I added a small comment after the code and explained that, thanks anyway


I prefer a command instead of addsiren parameter, because you don't need to recreate the vehicle in order to add a siren, you can do it while you're driving
Lol, physical siren and addsiren are two completely different things,
When you use addsiren, you won't have to recreate the vehicle in order to add the siren because it will never go away. Neither for adding a object.
Addsiren and adding a object doesn't have anything to do with each and another.
Reply
#7

їThat's OK?

SAPDVehicles[17] =
AddStaticVehicleEx(560,1529.1791000,-1688.0699000,5.5119000,-90.0000000,0,0,TIME_RESPAWN, 1); //Sultan
Reply
#8

Quote:
Originally Posted by LOLITO
Посмотреть сообщение
їThat's OK?

SAPDVehicles[17] =
AddStaticVehicleEx(560,1529.1791000,-1688.0699000,5.5119000,-90.0000000,0,0,TIME_RESPAWN, 1); //Sultan
NO
Use CreateVehicle , Syntax : (vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren=0) Source https://sampwiki.blast.hk/wiki/CreateVehicle
So the code should look like
PHP код:
SAPDVehicles[17] =
CreateVehicle(560,1529.1791000,-1688.0699000,5.5119000,-90.0000000,0,0,TIME_RESPAWN1); //Sultan 
EDIT: Yes your code also works, my bad. AddStaticVehicleEx also has the parameter for adding a siren like the one on createvehicle so yes both ways work.
Reply
#9

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
NO
Either way works fine.

He doesn't need to follow your exact code.
Reply
#10

Quote:
Originally Posted by Sew_Sumi
Either way works fine.

He doesn't need to follow your exact code.
Oh i thought he typed AddStaticVehicle not AddStaticVehicleEx and as addstaticvehicle doesnt have the addsiren parameter so i told him to use createvehicle instead but yeah you're right both work, cheers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)