Object is changing virtual world on its own
#1

When I create a new Dynamic Object and want to edit it via CreateDynamicObject, it just keeps setting it's own virtual world on 0, and I can't see it anymore. Here's the code.
pawn Код:
new Float:pPos[4];
   GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
   GetPlayerFacingAngle(playerid, pPos[3]);
   EventObject[playerid] = CreateDynamicObject(modelid, pPos[0]+(20.0 * floatsin(-pPos[3], degrees)), pPos[1]+(20.0 * floatcos(-pPos[3], degrees)), pPos[2], 90.0000, 0.0000, 0.0000, 1, -1, -1, 300.0);
   EditDynamicObject(playerid, EventObject[playerid]);
Reply
#2

When you create a dynamic object, it won't be "shown" for a player if he doesn't move. So, before using EditDynamicObject function, you should update streamer for the player:
PHP код:
   new Float:pPos[4];
   
GetPlayerPos(playeridpPos[0], pPos[1], pPos[2]);
   
GetPlayerFacingAngle(playeridpPos[3]);
   
EventObject[playerid] = CreateDynamicObject(modelidpPos[0]+(20.0 floatsin(-pPos[3], degrees)), pPos[1]+(20.0 floatcos(-pPos[3], degrees)), pPos[2], 90.00000.00000.00001, -1, -1300.0);
   
Streamer_Update(playeridSTREAMER_TYPE_OBJECT); // <-- updates dynamic objects for a player
   
EditDynamicObject(playeridEventObject[playerid]); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)