Raised This Month: $12 Target: $400
 3% 

What dose those codes do


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 08-05-2020 , 14:57   What dose those codes do
Reply With Quote #1

I was searching for codes those can remove c4 bomb from server and when i found one i get many problems so i got this code from zombie plague mod but it's not working with me and What dose those codes do.

zombieplague.ini file
Quote:
[Objective Entities] (and anything that would affect gameplay that needs to be removed)
CLASSNAMES = func_bomb_target , info_bomb_target , info_vip_start , func_vip_safetyzone , func_escapezone , hostage_entity , monster_scientist , func_hostage_rescue , info_hostage_rescue , env_fog , env_rain , env_snow , item_longjump , func_vehicle
PHP Code:
case SECTION_OBJECTIVE_ENTS:
            {
                if (
equal(key"CLASSNAMES"))
                {
                    
// Parse classnames
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                    {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
// Add to objective ents array
                        
ArrayPushString(g_objective_entskey)
                    }
                }
            } 


PHP Code:
new Array:g_objective_ents

g_objective_ents 
ArrayCreate(321)

// Prevent some entities from spawning
    
g_fwSpawn register_forward(FM_Spawn"fw_Spawn")

unregister_forward(FM_Spawng_fwSpawn)

// Entity Spawn Forward
public fw_Spawn(entity)
{
    
// Invalid entity
    
if (!pev_valid(entity)) return FMRES_IGNORED;
    
    
// Get classname
    
new classname[32], objective[32], size ArraySize(g_objective_ents)
    
pev(entitypev_classnameclassnamecharsmax(classname))
    
    
// Check whether it needs to be removed
    
for (new 0sizei++)
    {
        
ArrayGetString(g_objective_entsiobjectivecharsmax(objective))
        
        if (
equal(classnameobjective))
        {
            
engfunc(EngFunc_RemoveEntityentity)
            return 
FMRES_SUPERCEDE;
        }
    }
    
    return 
FMRES_IGNORED;

Supremache is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-05-2020 , 15:21   Re: What dose those codes do
Reply With Quote #2

They remove all entities with classnames specified in the list.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 08-05-2020 , 15:38   Re: What dose those codes do
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
They remove all entities with classnames specified in the list.
I know so it can remove c4 bomb right ? "func_bomb_target , info_bomb_target"
Supremache is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-05-2020 , 16:30   Re: What dose those codes do
Reply With Quote #4

Those are the bomb sites, not the bomb itself. But, yes, removing those means you can't plant the bomb anywhere even if you obtain it.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 08-05-2020 , 17:54   Re: What dose those codes do
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
Those are the bomb sites, not the bomb itself. But, yes, removing those means you can't plant the bomb anywhere even if you obtain it.
So it can't remove C4 bomb from t team
Supremache is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 08-05-2020 , 17:56   Re: What dose those codes do
Reply With Quote #6

Try to detect the bomber from t side and stripweapons xd
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 08-05-2020 , 21:49   Re: What dose those codes do
Reply With Quote #7

Quote:
Originally Posted by Shadows Adi View Post
Try to detect the bomber from t side and stripweapons xd
I used those code for bb mod and it can remove c4 bomb from T team but those code are disableing logevent_roundend from mod, So why i getting this problem
I also have checked zombieplague mod "15k lines" to find the codes for remove c4 bomb and i didn't found it
PHP Code:
new maxplayers

public plugin_init() {
    
maxplayers get_maxplayers()
    
removeit()
}

public 
removeit() {
    new 
doneonce 0
    
new fbombt find_ent_by_class(-1"func_bomb_target")
    while(
fbombt maxplayers)
        {
        
entity_set_int(fbombtEV_INT_flagsFL_KILLME)
        
doneonce 1
        fbombt 
find_ent_by_class(fbombt"func_bomb_target")
    }
    if(
doneonce == 1)server_cmd("sv_restartround 1")
    new 
ibombt find_ent_by_class(-1"info_bomb_target")
    while(
ibombt maxplayers)
        {
        
entity_set_int(ibombtEV_INT_flagsFL_KILLME)
        
ibombt find_ent_by_class(ibombt"info_bomb_target")
    }    
    return 
PLUGIN_CONTINUE


Last edited by Supremache; 08-05-2020 at 21:49.
Supremache is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 08-05-2020 , 23:20   Re: What dose those codes do
Reply With Quote #8

Quote:
Originally Posted by Supremache View Post
I was searching for codes those can remove c4 bomb from server and when i found one i get many problems so i got this code
Code:
new const SzEnts_c4[][] = {"func_bomb_target", "info_bomb_target"}; public plugin_cfg() {  new Ent = -1;  for(new remove;remove < sizeof SzEnts_c4;++remove)  while((Ent = engfunc(EngFunc_FindEntityByString, Ent, "classname", SzEnts_c4[remove])) != 0)  {   if(pev_valid(Ent))   {    engfunc(EngFunc_RemoveEntity, Ent);    server_cmd("sv_restartround 1")   }  } }
__________________

Last edited by DJEarthQuake; 08-06-2020 at 06:46. Reason: sv_restartround
DJEarthQuake is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 08-05-2020 , 23:37   Re: What dose those codes do
Reply With Quote #9

Quote:
Originally Posted by DJEarthQuake View Post
Code:
new const SzEnts_c4[][] = {"func_bomb_target", "info_bomb_target"}; public plugin_cfg() {  new Ent = -1;  for(new remove;remove < sizeof SzEnts_c4;++remove)  while((Ent = engfunc(EngFunc_FindEntityByString, Ent, "classname", SzEnts_c4[remove])) != 0)  {   if(pev_valid(Ent))   {    engfunc(EngFunc_RemoveEntity, Ent);   }  } }
I will test it thx
Edit: it's working but only after second round so do you think i need to add it for spawn..

Like that ?!
PHP Code:
// Prevent some entities from spawning
    
g_fwSpawn register_forward(FM_Spawn"fw_Spawn")

unregister_forward(FM_Spawng_fwSpawn

Last edited by Supremache; 08-06-2020 at 00:05.
Supremache is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 08-06-2020 , 06:38   Re: What dose those codes do
Reply With Quote #10

I added the much needed line to snip. Bots restarted round for me so I hardly noticed.
__________________
DJEarthQuake is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode