Setting an object's virtual world
#1

Is it possible without re-creating the object? Thank you.. (I'm using the Streamer plugin).
Reply
#2

Use
pawn Код:
native Streamer_SetIntData(type, {Text3D,_}:id, data, value);
with type STREAMER_TYPE_OBJECT, id your object ID and data E_STREAMER_WORLD_ID, like this:
pawn Код:
Streamer_SetIntData( STREAMER_TYPE_OBJECT, MyObject, E_STREAMER_WORLD_ID, 1 );
- will set MyObject's world to 1.
Reply
#3

yeah, found that after I posted, thank you anyway !

EDIT: did that, but it won't work, wtf.
Reply
#4

Maybe you used Streamer_SetIntData wrong. In the case that you can't manipulate an object's virtual world without re-creating it, I made this really quick, it compiles, and should work in-game. Because there wasn't a function to get an object's model, you'll have to know the model of the object beforehand.

pawn Код:
stock SetDynamicObjectVirtualWorld(objectid, model, virtualworld)
{
    if(IsValidDynamicObject(objectid)) {
        new
            Float:fPos[3],
            Float:fRotPos[3];
           
        GetDynamicObjectPos(objectid, fPos[0], fPos[1], fPos[2]);
        GetDynamicObjectRot(objectid, fRotPos[0], fRotPos[1], fRotPos[2]);
        DestroyDynamicObject(objectid);
       
        CreateDynamicObject(model, fPos[0], fPos[1], fPos[2], fRotPos[0], fRotPos[1], fRotPos[2], virtualworld, _, _, _);
        return 1;
    }
   
    else return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)