Instant AttachDynamicObjectToVehicle
#1

so when a player buys a spoiler for his bullet ,side skirts or bumpers i have this code

PHP код:
SpoilerBullet[vehicleid] = CreateDynamicObject(1003,0,0,0,0,0,0);
              
AttachDynamicObjectToVehicle(SpoilerBullet[vehicleid], vehicleid,  0.000000,-2.025000,0.300000,0.000000,0.000000,0.000000); 
the problem is the spoiler appear only after i respawn the car,how can i make it to be instant?so when he`s in the garage the spoiler willl instanlty appear on the car?
Reply
#2

You can call Streamer_UpdateEx with the position of the player, interior and virtual world when you attached the object.

Or you can enable idle updating by using Streamer_ToggleIdleUpdate when the player enters the tuning garage/shop, and turn it off when they leave. That will always update the items even if the player isn't moving. This isn't really neccessary outside of the shop since players that are AFK/idle don't need to be updated normally (this is a way to save some resources).
Reply
#3

Create the object near the vehicle & player... Not at 0,0,0


Also note that players client may crash when there is a incompatible/some vehicle components being attached to a vehicle when they are close to vehicle mod/tuning shop
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)