Help -
LOLITO - 12.12.2017
їHow do I put the siren of a patrol to a sultan?
Thanks in advance
Re: Help -
jasperschellekens - 12.12.2017
Add the addsiren parameter at the end
Код:
CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, addsiren=1)
Re: Help -
Lucases - 12.12.2017
PHP код:
CMD:siren(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, ANY_COLOR, "You aren't inside a vehicle");
new objectid = CreateObject(19620, 0, 0, 0, 0, 0, 0);
AttachObjectToVehicle(objectid, GetPlayerVehicleID(playerid), 0.009999, -0.019999, 0.854999, 0.000000, 0.000000, 0.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
Re: Help -
RogueDrifter - 12.12.2017
Quote:
Originally Posted by Lucases
PHP код:
CMD:siren(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, ANY_COLOR, "You aren't inside a vehicle");
new objectid = CreateObject(19620, 0, 0, 0, 0, 0, 0);
AttachObjectToVehicle(objectid, GetPlayerVehicleID(playerid), 0.009999, -0.019999, 0.854999, 0.000000, 0.000000, 0.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.
Re: Help -
Lucases - 12.12.2017
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
Re: Help -
jasperschellekens - 12.12.2017
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.
Re: Help -
LOLITO - 13.12.2017
їThat's OK?
SAPDVehicles[17] =
AddStaticVehicleEx(560,1529.1791000,-1688.0699000,5.5119000,-90.0000000,0,0,TIME_RESPAWN, 1); //Sultan
Re: Help -
RogueDrifter - 13.12.2017
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_RESPAWN, 1); //Sultan
EDIT: Yes your code also works, my bad. AddStaticVehicle
Ex also has the parameter for adding a siren like the one on createvehicle so yes both ways work.
Re: Help -
Sew_Sumi - 13.12.2017
Quote:
Originally Posted by RogueDrifter
NO
|
Either way works fine.
He doesn't need to follow your exact code.
Re: Help -
RogueDrifter - 13.12.2017
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.