Raised This Month: $ Target: $400
 0% 

dont spawn c4


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
G u i l l e
Junior Member
Join Date: Nov 2006
Old 11-29-2006 , 12:58   dont spawn c4
Reply With Quote #1

how can i made a plugin that block the c4, and dont allow spawn the c4


tnkz
G u i l l e is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 11-29-2006 , 13:00   Re: dont spawn c4
Reply With Quote #2

i think there's a flag, something like 'has_c4'.
find the flag, and do a remove function on the c4
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 11-29-2006 , 13:45   Re: dont spawn c4
Reply With Quote #3

Here is a code snippet (meaning it may not work or even compile, it's just a rough draft what you could possible do). Model name might not be right

Code:
public plugin_init() {     register_forward(FM_Spawn, "Forward_Spawn"); } public Forward_Spawn(ent) {     if (!pev_valid(ent))         return FMRES_IGNORED;     static classname[32];     static model[32];     classname[0]    = '^0';     model[0]    = '^0';     pev(ent, pev_classname, classname, 31);     pev(ent, pev_model, model, 31);         if (equal(classname, "grenade") && equal(model, "c4.mdl"))         return FMRES_SUPERCEDE;     return FMRES_IGNORED; }
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 11-29-2006 , 14:05   Re: dont spawn c4
Reply With Quote #4

you could try this:

Code:
public server_frame(){
new g_iBomb = find_ent_by_class(-1,"weapon_c4");
if(g_iBomb){
remove_entity(g_iBomb);
}
}
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-29-2006 , 14:26   Re: dont spawn c4
Reply With Quote #5

dutch meets way would be the best. i would go look at the tutorial by VEN "Bomb Scripting faq " .
The Specialist is offline
Send a message via AIM to The Specialist
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 11-29-2006 , 14:31   Re: dont spawn c4
Reply With Quote #6

Code:
#include <amxmodx> #include <fakemeta> #define PLUGIN "Bomb Removal" #define VERSION "0.1" #define AUTHOR "Orangutanz" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_forward(FM_SetModel, "SetModel") } public SetModel(entity, const model[]) {     if(equal(model, "models/w_c4.mdl"))     {         engfunc(EngFunc_RemoveEntity, entity)         return FMRES_SUPERCEDE     }     return FMRES_IGNORED }
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd

Last edited by Orangutanz; 11-29-2006 at 15:02.
Orangutanz is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-29-2006 , 14:57   Re: dont spawn c4
Reply With Quote #7

TOPIC HIJACK !!!! what is FM_set_model ? I know its a forward but whne is it called ?
The Specialist is offline
Send a message via AIM to The Specialist
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 11-29-2006 , 14:59   Re: dont spawn c4
Reply With Quote #8

When a model is set, hence its name
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-29-2006 , 15:05   Re: dont spawn c4
Reply With Quote #9

oh nice. ill have to use that some time thanks lol ++karma
The Specialist is offline
Send a message via AIM to The Specialist
VEN
Veteran Member
Join Date: Jan 2005
Old 11-30-2006 , 10:06   Re: dont spawn c4
Reply With Quote #10

Quote:
how can i made a plugin that block the c4, and dont allow spawn the c4
Code:
#include <amxmodx> #include <fakemeta> new const g_weapon_c4[] = "weapon_c4" public plugin_init() {     register_plugin("Block weapon_c4", "0.1", "VEN")     register_forward(FM_CreateNamedEntity, "fwCreateNamedEntity") } public fwCreateNamedEntity(iClassname) {     static szClassname[sizeof g_weapon_c4 + 1]     engfunc(EngFunc_SzFromIndex, iClassname, szClassname, sizeof g_weapon_c4)     if (equal(szClassname, g_weapon_c4))         return FMRES_SUPERCEDE     return FMRES_IGNORED }
Note: this will block only the "weapon_c4" entity creation.
This will not block:
- bomb StatusIcon
- hud text "You have the bomb..."
- bomb backpack model on the player's back
- log message "... spawned with the bomb"
If you want to block all of that you can look in my CTF mod source code: http://forums.alliedmods.net/attachm...9&d=1162322381


Quote:
i think there's a flag, something like 'has_c4'
This will not help - the flag removal will not remove the actual c4 entity.


Quote:
Here is a code snippet
This will not work - Spawn is actually called only on map's entities load (at map start).


Quote:
you could try this
You should avoid StartFrame if possible to not hit the performance.


Quote:
Code:
if(equal(model, "models/w_c4.mdl"))
        engfunc(EngFunc_RemoveEntity, entity)
I don't think he meant the planted C4.

Last edited by VEN; 11-30-2006 at 10:16.
VEN 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:57.


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