Results 1 to 10 of 32

Thread: Modify SD Bombs

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    This is how to do it:

    PHP Code:
    replaceModels()
    {
        
    level.saved_origin = [];
        
        
    entitytypes getentarray();
        for( 
    0entitytypes.sizei++ )
        {
            if( 
    isdefinedentitytypes[i].script_gameobjectname ) )
            {
                
    gameobjectnames strtokentitytypes[i].script_gameobjectname" " );
                
                for( 
    0gameobjectnames.sizek++ )
                {
                    if( 
    gameobjectnames[k] == "bombzone" )
                    {    
                        if( 
    entitytypes[i].classname == "script_model" )
                        {
                            
    level.saved_origin[level.saved_origin.size] = entitytypes[i].origin;
                            
    entitytypes[idelete();
                        }
                    }
                }

            }
        }

        for( 
    i=0level.saved_origin.sizei++ )
        {
            
    replace spawn"script_model"level.saved_origin[i] );
            
    replace setModel"xmodel/vehicle_halftrack_rockets_snow_static" );
        }

        
    entitytypes getentarray();
        for( 
    0entitytypes.sizei++ )
        {
            if( 
    isdefinedentitytypes[i].script_gameobjectname ) )
            {
                
    gameobjectnames strtokentitytypes[i].script_gameobjectname" " );
                
                for( 
    0gameobjectnames.sizek++ )
                {
                    if( 
    gameobjectnames[k] == "bombzone" )
                    {    
                        if( 
    entitytypes[i].classname == "script_brushmodel" )
                        {
                            
    entitytypes[idelete();
                        }
                    }
                }

            }
        }

    You see the method at the foot of the function - it searches for all entities with the script_objectivename of "bombzone". Then it searches for all script_brushmodels within those entities. Then it deletes them. Simple!

    Narrowing down your search enables you to target the clips in a certain area. Otherwise, you would end up deleting all the clips on the map. And that's no good.

  2. The Following User Says Thank You to Tally For This Useful Post:

    Loveboy (16th October 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •