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

[REQ] Admin Can Make C4 Unusable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alibalali
Member
Join Date: Aug 2014
Old 09-14-2014 , 03:52   [REQ] Admin Can Make C4 Unusable
Reply With Quote #1

I want a plugin that can be handled by a cvar when admin uses that cvar the c4 bomb should be unusable.
some thing like this cvar:
PHP Code:
amx_nobomb <0|1//(0:bomb is usable |1:bomb is not usable) 
I founded this one to do that but it not affect until a round restart
PHP Code:
#include < amxmodx  > 
#include < engine   > 
#include < fakemeta > 
#include < cstrike  > 
new iMsg 
new gPcvarbmb
public plugin_init ( ) { 
     
    
gPcvarbmb register_cvar("amx_nobomb""0");
        
    
RemoveBombSites ( ) 
    
register_logevent "OnPlayerSpawnWithBomb"3"2=Spawned_With_The_Bomb" 
    
    
iMsg get_user_msgid"StatusIcon" 

public 
RemoveBombSites ( ) { 
     
    if (
get_pcvar_num(gPcvarbmb) == 1){
    new 
Ent = - 
     
    
while ( Ent == find_ent_by_class Ent "func_bomb_target" ) ) 
        
remove_entity Ent 
     
    while ( 
Ent == find_ent_by_class Ent "info_bomb_target" ) ) 
        
remove_entity Ent 
}

public 
OnPlayerSpawnWithBomb ( ) { 
 
 if (
get_pcvar_num(gPcvarbmb) == 1){
    new 
loguser 80 ] , name 32 
    
read_logargv 0logusersizeof loguser ) -
    
parse_loguser logusernamesizeof name ) -
     
    new 
id get_user_index(name
    
cs_set_user_bpammoidCSW_C4
     
    
message_begin(MSG_ONEiMsg _id 
    
write_byte 
    
write_string "c4" 
    
message_end ( ) 
   }
     

Edit:
Sorry I forgot to say something>If c4 completely be removed from the map It will be perfect.

Last edited by alibalali; 09-14-2014 at 05:34.
alibalali is offline
Slander
Junior Member
Join Date: Sep 2013
Old 09-15-2014 , 10:31   Re: [REQ] Admin Can Make C4 Unusable
Reply With Quote #2

If i understand well, you want to remove the bomb sites and the bomb (item) from all maps?

If the answer is yes, you can use your plugin, just use "gPcvarbmb = register_cvar("amx_nobomb", "1");" instead of "gPcvarbmb = register_cvar("amx_nobomb", "0");".
Slander is offline
alibalali
Member
Join Date: Aug 2014
Old 09-15-2014 , 11:39   Re: [REQ] Admin Can Make C4 Unusable
Reply With Quote #3

I'm not completely noob. I understand this.
my problem is when the cvar will change to 1 or 0 (during the game play) It will not affect until the round restart.
alibalali is offline
Slander
Junior Member
Join Date: Sep 2013
Old 09-16-2014 , 11:40   Re: [REQ] Admin Can Make C4 Unusable
Reply With Quote #4

Yes.. I can give you an idea, how to make this works:
A command like /c4 with params on/off (eg. /c4 on /c4 off).
When you type /c4 off, to remove the c4 from the one who carries it.
And for /c4 on, you can give to a random TERRORIST the bomb.
Also, you need a variable to set 1 or 0, to know where is ON/OFF, and check it every round to know if you need to spawn one from terrorists with c4 or not.

I haven't enough time right now, but if you won't make it, i will help you with the plugin.
Slander is offline
alibalali
Member
Join Date: Aug 2014
Old 09-16-2014 , 12:00   Re: [REQ] Admin Can Make C4 Unusable
Reply With Quote #5

Quote:
Originally Posted by Slander View Post
Yes.. I can give you an idea, how to make this works:
A command like /c4 with params on/off (eg. /c4 on /c4 off).
When you type /c4 off, to remove the c4 from the one who carries it.
And for /c4 on, you can give to a random TERRORIST the bomb.
Also, you need a variable to set 1 or 0, to know where is ON/OFF, and check it every round to know if you need to spawn one from terrorists with c4 or not.

I haven't enough time right now, but if you won't make it, i will help you with the plugin.
your idea is perfect and also amazing.
I will wait for your plugin
special thanks
alibalali is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 09-16-2014 , 14:28   Re: [REQ] Admin Can Make C4 Unusable
Reply With Quote #6

untested:
PHP Code:
#include < amxmodx  > 
#include < engine   > 
#include < fakemeta > 
#include < cstrike  > 
new iMsg 
new gPcvarbmb
public plugin_init ( ) { 
     
    
gPcvarbmb register_cvar("amx_nobomb""0");
        
    
RemoveBombSites ( ) 
    
register_logevent "OnPlayerSpawnWithBomb"3"2=Spawned_With_The_Bomb" 
    
register_clcmd("say /c4""RemoveBombSites"ADMIN_KICK)
    
iMsg get_user_msgid"StatusIcon" 

public 
RemoveBombSites ( ) { 
     
    
//if (get_pcvar_num(gPcvarbmb) == 1){
    
new Ent = - 
     
    
while ( Ent == find_ent_by_class Ent "func_bomb_target" ) ) 
        
remove_entity Ent 
     
    while ( 
Ent == find_ent_by_class Ent "info_bomb_target" ) ) 
        
remove_entity Ent 
//}

public 
OnPlayerSpawnWithBomb ( ) { 
 
 if (
get_pcvar_num(gPcvarbmb) == 1){
    new 
loguser 80 ] , name 32 
    
read_logargv 0logusersizeof loguser ) -
    
parse_loguser logusernamesizeof name ) -
     
    new 
id get_user_index(name
    
cs_set_user_bpammoidCSW_C4
     
    
message_begin(MSG_ONEiMsg _id 
    
write_byte 
    
write_string "c4" 
    
message_end ( ) 
   }
     

__________________
JusTGo is offline
alibalali
Member
Join Date: Aug 2014
Old 09-16-2014 , 18:02   Re: [REQ] Admin Can Make C4 Unusable
Reply With Quote #7

Quote:
Originally Posted by JusTGo View Post
untested:
PHP Code:
#include < amxmodx  > 
#include < engine   > 
#include < fakemeta > 
#include < cstrike  > 
new iMsg 
new gPcvarbmb
public plugin_init ( ) { 
     
    
gPcvarbmb register_cvar("amx_nobomb""0");
        
    
RemoveBombSites ( ) 
    
register_logevent "OnPlayerSpawnWithBomb"3"2=Spawned_With_The_Bomb" 
    
register_clcmd("say /c4""RemoveBombSites"ADMIN_KICK)
    
iMsg get_user_msgid"StatusIcon" 

public 
RemoveBombSites ( ) { 
     
    
//if (get_pcvar_num(gPcvarbmb) == 1){
    
new Ent = - 
     
    
while ( Ent == find_ent_by_class Ent "func_bomb_target" ) ) 
        
remove_entity Ent 
     
    while ( 
Ent == find_ent_by_class Ent "info_bomb_target" ) ) 
        
remove_entity Ent 
//}

public 
OnPlayerSpawnWithBomb ( ) { 
 
 if (
get_pcvar_num(gPcvarbmb) == 1){
    new 
loguser 80 ] , name 32 
    
read_logargv 0logusersizeof loguser ) -
    
parse_loguser logusernamesizeof name ) -
     
    new 
id get_user_index(name
    
cs_set_user_bpammoidCSW_C4
     
    
message_begin(MSG_ONEiMsg _id 
    
write_byte 
    
write_string "c4" 
    
message_end ( ) 
   }
     

It's like that I posted.
/c4 is not usable (don't do any thing) .after using bomb can be planted
after changing amx_nobomb to 1 and saying /c4 nothing happened but after round restart player was not able to use c4
the problem of plugin that I posted is needing round restart to take effect
alibalali is offline
alibalali
Member
Join Date: Aug 2014
Old 09-16-2014 , 18:20   Re: [REQ] Admin Can Make C4 Unusable
Reply With Quote #8

If plugin spawn all terrorists without any c4 (something like csdm do) necessity of round restart will not be important
alibalali is offline
alibalali
Member
Join Date: Aug 2014
Old 07-10-2015 , 21:42   Re: [REQ] Admin Can Make C4 Unusable
Reply With Quote #9

can any one create a plugin that completely remove c4 from de maps
when admin enables the plugin if some one carry c4 bomb be disarmed and c4 disappear from both map and radar and also in score table
if the bomb is on the ground bomb be disappear from map and radar
if round be restarted until the plug is enable, in round start plugin do the same
its not important that c4 sites be removed
__________________
Going to be Banned
alibalali is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-11-2015 , 05:32   Re: [REQ] Admin Can Make C4 Unusable
Reply With Quote #10

Try this(hope I understood what you want). You will need orpheu module for it.

In addons/amxmodx/configs/orpheu/virtualFunctions create a folder called CGameRules and inside a file called GiveC4. Copy inside it:

Code:
{
	"name" : "GiveC4",
	"class" : "CGameRules",
	"library" : "mod",
	"indexes" : 
	[
		{
			"os" : "windows",
			"mod" : "cstrike",
			"value" : 67
		},
		{
			"os" : "linux",
			"mod" : "cstrike",
			"value" : 69
		}
	]
}
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <orpheu>
#include <engine>
#include <fakemeta>
#include <cstrike>

#define PluginName    "Remove the bomb"
#define PluginVersion "0.1"
#define PluginAuthor  "HamletEagle"

new pGameRulesObject
new gmsgStatusIcon
new gmsgScoreAttrib

new OrpheuFunction:HandleGiveC4Func
new bool:PluginEnabled

public plugin_precache()
{
    new 
OrpheuFunction:HandleInstallGameRulesFunc OrpheuGetFunction("InstallGameRules")
    
OrpheuRegisterHook(HandleInstallGameRulesFunc"OnInstallGameRules"OrpheuHookPost)
}
public 
OnInstallGameRules()
{
    
pGameRulesObject OrpheuGetReturn() 
}  

public 
plugin_init()
{
    
register_plugin
    
(
        .
plugin_name PluginName,
        .
version     PluginVersion,
        .
author         PluginAuthor
    
)
    
    
gmsgStatusIcon get_user_msgid("StatusIcon"
    
gmsgScoreAttrib get_user_msgid"ScoreAttrib" )
    
    
register_concmd("amx_removebomb""ClientCommand_RemoveBomb"ADMIN_KICK)
    
    
HandleGiveC4Func OrpheuGetFunctionFromObject(pGameRulesObject"GiveC4""CGameRules")
    
OrpheuRegisterHook(HandleGiveC4Func"OnGiveC4"OrpheuHookPre)
}

public 
ClientCommand_RemoveBomb(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
    {
        return 
1
    
}
    
    new const 
Message[][] = {"enabled""disabled"
    
    
PluginEnabled = !PluginEnabled
    client_print
(idprint_chat"You have %s the bomb"Message[PluginEnabled])
    
    if(
PluginEnabled)
    {
        new 
C4Entity find_ent_by_class(-1"weapon_c4")
        if(
pev_valid(C4Entity))
        {
            new 
Owner pev(C4Entitypev_owner)
            
            
engclient_cmd(Owner"weapon_c4")
            
cs_set_user_bpammo(OwnerCSW_C40)
            
engclient_cmd(Owner"lastinv")
            
            
message_begin(MSG_ONE_UNRELIABLEgmsgStatusIcon_id)
            {
                
write_byte(0)
                
write_string("c4")
                
message_end()
            }
            
            
message_begin(MSG_ONE_UNRELIABLEgmsgScoreAttrib_id)
            {
                
write_byte(Owner)
                
write_byte(0)
                
message_end()
            }
        }
    }
    return 
1
}

public 
OrpheuHookReturn:OnGiveC4(GameRulesObject)
{
    if(
PluginEnabled)
    {
        return 
OrpheuSupercede
    
}
    
    return 
OrpheuIgnored

The command is amx_removebomb, default admin access is ADMIN_KICK. Write the command one time to block the bomb, write it again to re-enable it(the bomb won't be given instantly, but only on new round - if you want the bomb to be given to a player when you enable it tell me).
__________________

Last edited by HamletEagle; 07-11-2015 at 05:36.
HamletEagle is offline
Reply



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 10:53.


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