Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 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. }
  12.  
  13. //Your custom spawned objects
  14. SpawnObject( "bldr_wall_wood4_pole", "11499.603516 342.455200 11351.873047", "100.000008 0.000000 0.000000" );
  15. SpawnObject( "Land_FuelStation_Feed", "11434.489258 330.371643 11365.093750", "37.000000 0.000000 0.000000" );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement