DynamicObject Info
#1

I wanted to know if we put -1 in CreateDynamicObject native function in worldid or interior parameter, does it mean that it disables it or it applies to all worlds? And if we do not even bother going any further across the worldid parameter, does that mean that it will apply to all worldids and interiors?
Reply
#2

Quote:
Originally Posted by Penguin1997
Посмотреть сообщение
I wanted to know if we put -1 in CreateDynamicObject native function in worldid or virtual world parameter, does it mean that it disables it or it applies to all worlds?
All worlds, that's why it's -1 by default. It wouldn't disable objects by default... XD
Reply
#3

if you check CreateDynamicObject native in streamer include you will see their default value [ if not re set ] is -1 so that mean -1 tell the script to show the object in all worlds / interiors...
PHP код:
native STREAMER_TAG_OBJECT CreateDynamicObject(modelidFloat:xFloat:yFloat:zFloat:rxFloat:ryFloat:rzworldid = -1interiorid = -1playerid = -1Float:streamdistance STREAMER_OBJECT_SDFloat:drawdistance STREAMER_OBJECT_DDSTREAMER_TAG_AREA areaid STREAMER_TAG_AREA -1priority 0); 
also you can use .varname = value, to set special var's value for ex:
PHP код:
CreateDynamicObject(13607, -1460.199829, -943.961182219.3486480.00000.00000.0000, .playerid 1); 
Reply
#4

Right.. I've added some dynamic objects on Ongamemodinit callback, but they only appear when I click on spawn. They should appear all the time, the camera angle is actually where my objects are suppose to show, its all in the logging process.

Heres one of the line of code:
Код:
CreateDynamicObject(12957,1817.8000000,-1281.3000000,131.6000100,0.0000000,0.0000000,40.0000000); //object(sw_pickupwreck01) (1)
Reply
#5

Quote:
Originally Posted by Penguin1997
Посмотреть сообщение
Right.. I've added some dynamic objects on Ongamemodinit callback, but they only appear when I click on spawn.

Heres one of the line of code:
Код:
CreateDynamicObject(12957,1817.8000000,-1281.3000000,131.6000100,0.0000000,0.0000000,40.0000000); //object(sw_pickupwreck01) (1)
if I am not wrong if you want them to show on players select class you've to use streamer update under OnPlayerRequestClass, here's example:
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
Streamer_UpdateEx(playerid1817.8000000, -1281.3000000131.6000100);

if I am not wrong streamer used to stream the objects when OnPlayerUpdate callback getting called, so if player is not spawned properly yet [ choosing class... ] it won't stream the objects for him.
Reply
#6

Quote:
Originally Posted by jlalt
Посмотреть сообщение
if I am not wrong if you want them to show on players select class you've to use streamer update under OnPlayerRequestClass, here's example:
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
Streamer_UpdateEx(playerid1817.8000000, -1281.3000000131.6000100);

if I am not wrong streamer used to stream the objects when OnPlayerUpdate callback getting called, so if player is not spawned properly yet [ choosing class... ] it won't stream the objects for him.
well done, repped.

Quote:
Originally Posted by Crayder
Посмотреть сообщение
All worlds, that's why it's -1 by default. It wouldn't disable objects by default... XD
Thanks and repped
Reply
#7

@jlalt... Not exactly. You are right about Streamer_UpdateEx, but not the rest. By default streamer only update players when the players move, and players do not move when they are in class selection. You can use UpdateEx to manually update the player while they are in class selection. You can also tell streamer to update players on a timer instead of by movement, which will also make class selection streamer work, but that's not recommended because it will send useless updates when the players are standing still.

@Peng... You can't rep bud, you're still too newb.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)