TheGamingChief icon

DayZCommunityOfflineMode Spawn helper function

TheGamingChief | PRO | 04/13/20 06:31:06 AM UTC | 0 ⭐ | 8267 👁️ | Never ⏰ | []
C |

500 B

|

None

|

0 👍

/

0 👎

//Spawn helper function
void SpawnObject( string type, vector position, vector orientation )
{
    auto obj = GetGame().CreateObject( type, position );
    obj.SetPosition( position );
    obj.SetOrientation( orientation );
    obj.SetOrientation( obj.GetOrientation() ); //Collision fix
    obj.Update();
    obj.SetAffectPathgraph( true, false );
    if( obj.CanAffectPathgraph() ) GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( GetGame().UpdatePathgraphRegionByObject, 100, false, obj );
}

Comments