AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Remove C4 (https://forums.alliedmods.net/showthread.php?t=325750)

Supremache 07-04-2020 18:41

Remove C4
 
Hi guys,
I have problem in C4 , because in bb mod when someone be zombie he's get c4 like a normal mod and i dont like that so i was searching for plugin to remove c4 from zombie and i found it but i have got error, becuase in bb mod it working on fakemeta and in this plugin working on fakemeta_until.

Is there any code in fakemeta working like "fm_strip_user_gun".


Error log
Code:

L 07/04/2020 - 23:57:21: [AMXX] Run time error 3: stack error
L 07/04/2020 - 23:57:21: [AMXX]    [0] fakemeta_util.inc::fm_strip_user_gun (line 671)
L 07/04/2020 - 23:57:21: [AMXX]    [1] Zombie BaseBuilderUltimatX.sma::GotBomb (line 1115)

Plugin:
PHP Code:

#include <amxmodx>
#include <fakemeta_util>

public plugin_init() {
    
register_plugin("No Bomb""0.1""connor")
    
register_event("StatusIcon""GotBomb""be""1=1""1=2""2=c4")
}

public 
GotBomb(id) {
    
fm_strip_user_gun(idCSW_C4)



+ARUKARI- 07-04-2020 19:21

Re: Remove C4
 
https://forums.alliedmods.net/showthread.php?t=40164

PHP Code:

// Bomb gained (including spawn/give_item) event
    
register_event("WeapPickup""event_function""be""1=6"

PHP Code:

// How to strip the bomb from a player?
    
engclient_cmd(id"weapon_c4")
    
cs_set_user_bpammo(idCSW_C40)
    
engclient_cmd(id"lastinv")
    
// remove bomb hud icon
    
message_begin(MSG_ONEget_user_msgid("StatusIcon"), _id)
    
write_byte(0)
    
write_string("c4")
    
message_end() 


Supremache 07-09-2020 15:41

Re: Remove C4
 
Quote:

Originally Posted by +ARUKARI- (Post 2708678)
https://forums.alliedmods.net/showthread.php?t=40164

PHP Code:

// Bomb gained (including spawn/give_item) event
    
register_event("WeapPickup""event_function""be""1=6"

PHP Code:

// How to strip the bomb from a player?
    
engclient_cmd(id"weapon_c4")
    
cs_set_user_bpammo(idCSW_C40)
    
engclient_cmd(id"lastinv")
    
// remove bomb hud icon
    
message_begin(MSG_ONEget_user_msgid("StatusIcon"), _id)
    
write_byte(0)
    
write_string("c4")
    
message_end() 


Thanks it's worked fine, I think that Oo
Do you know how to add it like set_tesk without register_event becuase i want to add it for respown event
Ps: i tried but i got some erorrs like the game get closed automaticly

DJEarthQuake 06-14-2021 07:56

Re: Remove C4
 
Quote:

Originally Posted by Supremache (Post 2709465)
Ps: i tried but i got some erorrs like the game get closed automaticly


Remove from Zombies or altogether, error-free?

Code:
#include amxmodx #include engine_stocks new const c4[][]={"weapon_c4","func_bomb_target","info_bomb_target"}; public plugin_init() {     register_plugin("c4 killer", "SPiNX", "04-2021");     for(new ent;ent < sizeof c4;++ent)         remove_entity_name(c4[ent]); }

Supremache 06-14-2021 16:40

Re: Remove C4
 
Quote:

Originally Posted by DJEarthQuake (Post 2749703)
Remove from Zombies or altogether, error-free?

Code:
#include amxmodx #include engine_stocks new const c4[][]={"weapon_c4","func_bomb_target","info_bomb_target"}; public plugin_init() {     register_plugin("c4 killer", "SPiNX", "04-2021");     for(new ent;ent < sizeof c4;++ent)         remove_entity_name(c4[ent]); }



Have you tested it?
I actually made plugin for removing c4 from that tutorial that @+ARUKARI- gave me

https://forums.alliedmods.net/showthread.php?t=332835

DJEarthQuake 06-15-2021 15:17

Re: Remove C4
 
It works. I consider it more of a line of a code than a plugin although it is.

Supremache 06-15-2021 16:52

Re: Remove C4
 
Well, I will test it when I finish my exams and give you my opinion

DJEarthQuake 06-15-2021 20:45

Re: Remove C4
 
An ounce of prevention is worth a pound of cure. It is much easier to void bomb from the game than it is to perpetually handle it each round IMHO. Best of luck with the exams.


All times are GMT -4. The time now is 17:14.

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