Posts: 70
Threads: 21
Joined: Dec 2014
Reputation:
0
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?
Posts: 3,324
Threads: 96
Joined: Sep 2013
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
Posts: 1,266
Threads: 6
Joined: Oct 2014
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(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);
also you can use .varname = value, to set special var's value for ex:
PHP код:
CreateDynamicObject(13607, -1460.199829, -943.961182, 219.348648, 0.0000, 0.0000, 0.0000, .playerid = 1);
Posts: 1,266
Threads: 6
Joined: Oct 2014
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(playerid, classid)
{
Streamer_UpdateEx(playerid, 1817.8000000, -1281.3000000, 131.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.
Posts: 3,324
Threads: 96
Joined: Sep 2013
@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.