TheGamingChief

DayZCommunityOfflineMode Spawn helper function

Apr 13th, 2020
7,890
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. //Spawn helper function
  2. void SpawnObject( string type, vector position, vector orientation )
  3. {
  4.     auto obj = GetGame().CreateObject( type, position );
  5.     obj.SetPosition( position );
  6.     obj.SetOrientation( orientation );
  7.     obj.SetOrientation( obj.GetOrientation() ); //Collision fix
  8.     obj.Update();
  9.     obj.SetAffectPathgraph( true, false );
  10.     if( obj.CanAffectPathgraph() ) GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( GetGame().UpdatePathgraphRegionByObject, 100, false, obj );
  11. }
Advertisement
Add Comment
Please, Sign In to add comment