PDA

View Full Version : Stock "breaks" CreateDynamicObject?


reckst4r
23/10/2013, 05:17 PM
Hi. I got a little help regarding an object streaming issue a few days ago, and I was given a stock function, however, it seems to break the CreateDynamicObject function. Whenever I use the stock, the object isn't created.


stock AddDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0, drawdistance = 300.0)
{
new oid;
oid = CreateDynamicObject(modelid, x, y, z, rx, ry, rz, worldid, interiorid, playerid, streamdistance);
Streamer_SetFloatData(STREAMER_TYPE_OBJECT, oid, E_STREAMER_DRAW_DISTANCE, 300.0);
return oid;
}

Pottus
23/10/2013, 05:24 PM
I made that one, there is actually a small problem here....

stock AddDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0, drawdistance = 300.0)
{
new oid;
oid = CreateDynamicObject(modelid, x, y, z, rx, ry, rz, worldid, interiorid, playerid, streamdistance);
Streamer_SetFloatData(STREAMER_TYPE_OBJECT, oid, E_STREAMER_DRAW_DISTANCE, drawdistance);
return oid;
}

Make sure you use the right stream/draw distance

reckst4r
23/10/2013, 05:26 PM
You did indeed, and I'm not exactly sure what you mean. How can I use a wrong stream/draw distance?

reckst4r
23/10/2013, 06:34 PM
It doesn't seem to be applying this part "Streamer_SetFloatData(STREAMER_TYPE_OBJECT, oid, E_STREAMER_DRAW_DISTANCE, 300.0);"

edit: ahh, crap.. I thought I had pressed the edit button.. Sorry for double posting then

update: If I use CreateObject the distance is good, but I'd still prefer using CreateDynamicObject.