Object codes - 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: Object codes (
/showthread.php?tid=608043)
Object codes -
CSLangdale - 26.05.2016
Does createdynamicobject code use different object ids to createobject cause if I have create object for my /siren command it spawns the right object but you have to mess around to get it to work then when I add dynamic into the code it spawns a different object
Re: Object codes -
andrejc999 - 27.05.2016
CreateDynamicObject is a command from a plugin called "streamer" and no it uses the same object ids but as you said you can mess around with objects made by CreateDynamicObject...
Use this:
Код:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0);
EDIT:
To add siren to a vehicle you must do it in CreateVehicle!
Just instead of this:
Код:
CreateVehicle(modelid, x, y, z, Angle, color 1, color 2, respawn delay);
Use this:
Код:
CreateVehicle(modelid, x, y, z, Angle, color 1, color 2, respawn delay, siren(add siren = 1, no siren = 0));
Re: Object codes -
CSLangdale - 27.05.2016
So in my create vehicle stock I need to add the siren part onto it? And when I do that I get undefined symbol for "siren" and "no"
Re: Object codes -
andrejc999 - 27.05.2016
What kind of siren are you adding? If you mean like siren from police then just add 1 at the end as I said...
Re: Object codes -
Konstantinos - 27.05.2016
Quote:
Originally Posted by andrejc999
and no it uses the same object ids
|
If you are not referring to the object model ID, then it does not.
@CSLangdale: In 0.3.7 a parameter 'addsiren' was added in CreateVehicle function. Set it to 1 to enable the siren.
Re: Object codes -
CSLangdale - 27.05.2016
When I put a one in the stock it complains at me for it says number of arguments doesn't match definition?
Re: Object codes -
Konstantinos - 27.05.2016
Keep that parameter last and set it by default to 0. When a siren should be added, set the parameter (when calling the function) to 1 and use that parameter in CreateVehicle.