ItsMods

Full Version: create entity to use with createCarryObject()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
is it possible to create an entity and use it with the following:

PHP Code:
        visuals[0] = getEnt"sab_bomb""targetname" );
    if ( !
isDefinedvisuals[0] ) ) 
    {
        
error"No sab_bomb script_model found in map." );
        return;
    } 

here it gets the entity "sab_bomb" from the map but i want it to load an object with a custumizable origin...

something like this:

PHP Code:
CreateIntel(posangle)

    
visuals[0] = Intel
    
if ( !isDefinedvisuals[0] ) ) 
    {
        
error"No sab_bomb script_model found in map." );
        return;
    }
    
    
Intel spawn("script_model"pos+(0,0,30), 1);
    
Intel.angles angle;
    
Intel SetOwnerlevel );
    
Intel setModel("t5_weapon_briefcase_world"); 

anybody know how?

EDIT: Really? no one? Sad
C++ Code
  1. CreateIntel(pos, angle)
  2.  
  3. visuals[0] = Intel
  4. if ( !isDefined( visuals[0] ) )
  5. {
  6. error( "No sab_bomb script_model found in map." );
  7. return;
  8. }
  9.  
  10. Intel = spawn("script_model", pos+(0,0,30), 1);
  11. Intel.angles = angle;
  12. Intel SetOwner( level );
  13. Intel setModel("t5_weapon_briefcase_world");
  14.  
  15. Intel thread intThink();
  16. }
  17. intThink()
  18. {
  19. self endon("death");
  20. self endon("disconnect");
  21. area = spawn("trigger_radius", self.origin, 0, 50, 50);
  22. while(1){
  23. area waittill("trigger", player);
  24. self.hint = "Press F to carry";
  25. if(player UseButtonPressed())
  26. {
  27. code
  28. }
  29. wait .000001;
  30. }
  31. }
Thanx but thats not really what I mean... I want to create an object that can be picked up and if its picked up the player gets weapons & perks and stuff, I can do that with this code but the problem is only that if the player dies he doesnt drop anything and dropping the object (intel) is quite important ...

also, is it possible to register the number of intels a player has so i can use this:
PHP Code:
if(self.hasIntels == 3)
        {
         
self thread giveSuperPowers();
        }