Raised This Month: $ Target: $400
 0% 

Blocking spawned CSDM items


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-30-2007 , 11:20   Re: Blocking spawned CSDM items
Reply With Quote #1

Yeah, hook the touch forward, then put this...

Code:
static model[32];
pev(Ent, pev_model, model, sizeof model - 1);
 
if(containi(model, "w_shield.mdl") != -1)
{
    //Touched ent has "w_shield.mdl" model.
}
I use this in one of my plugins, and works.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 11-12-2007 , 17:57   Re: Blocking spawned CSDM items
Reply With Quote #2

Sorry to be a bother but I tried to block the spawned items from item mode by model... Still no good.
It only blocks the normal weapons from CS.

Does anyone have a solution to my problem? I tried looking in the source of item mode but didn't give me much info.
__________________
It's a mystery.
Mini_Midget is offline
Old 11-12-2007, 19:59
Arkshine
This message has been deleted by Arkshine. Reason: I'm wrong.
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-12-2007 , 23:26   Re: Blocking spawned CSDM items
Reply With Quote #4

Well it's really hard to block them since the items are given immediately.
The 'csdm_itemmode.amxx' plugin uses the 'FM_Touch' forward too.

When you touch a weapon it calls the 'csdm_give_item()' native.
If you disable this forward in this plugin, you will not be able to take the items.
So creating a plugin and hooking FM_Touch forward will not work.

Why don't you remove all items ( csdm* ) instead of trying to block them?
I don't understand what you want really to do.
__________________
Arkshine is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 11-13-2007 , 00:02   Re: Blocking spawned CSDM items
Reply With Quote #5

http://forums.alliedmods.net/showthr...sdm#post542618
__________________
It's a mystery.
Mini_Midget is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-13-2007 , 02:19   Re: Blocking spawned CSDM items
Reply With Quote #6

Do you load your plugin before csdm plugins ?
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-13-2007 , 02:36   Re: Blocking spawned CSDM items
Reply With Quote #7

Well you can destroy all items & packs. I've tested this 2 functions with a command and it works fine. But it seems to be not really very safe.
A better way would be to get the items id at their creation, storing in a array then after deleting them. I think.

Code:
    new g_sEntClass[][] =     {         "csdmw_p228",         "csdmw_scout",         "csdmw_hegrenade",         "csdmw_xm1014",         "csdmw_mac10",         "csdmw_aug",         "csdmw_smokegrenade",         "csdmw_elite",         "csdmw_fiveseven",         "csdmw_ump45",         "csdmw_sg550",         "csdmw_galil",         "csdmw_famas",         "csdmw_usp",         "csdmw_glock18",         "csdmw_awp",         "csdmw_mp5navy",         "csdmw_m249",         "csdmw_m3",         "csdmw_m4a1",         "csdmw_tmp",         "csdmw_g3sg1",         "csdmw_flashbang",         "csdmw_deagle",         "csdmw_sg552",         "csdmw_ak47",         "csdmw_p90",         "csdm_longjump",         "csdm_medkit",         "csdm_battery",         "csdm_pistolammo",         "csdm_rifleammo",         "csdm_shotammo",         "csdm_smgammo",         "csdm_awpammo",         "csdm_paraammo",         "csdm_fullammo",         "csdm_armor",         "csdm_deathpack"     }     new const         g_iSize_ec = charsmax( g_sEntClass ),         g_sClassname[] = "classname";         // [...]         Destroy_Items()     {         new ent = -1;         for( new i; i < g_iSize_ec ; i++ )         {             ent = -1;             while( ( ent = engfunc( EngFunc_FindEntityByString, ent, g_sClassname, g_sEntClass[i] ) ) )             {                   if( pev_valid( ent ) )                     engfunc( EngFunc_RemoveEntity, ent );             }         }     }         Destroy_pack( owner )     {         new ent = -1;         while( ( ent = engfunc( EngFunc_FindEntityByString, ent, g_sClassname, g_sEntClass[ g_iSize_ec ] ) ) && pev( ent, pev_owner ) != owner )         {             if( pev_valid( ent ) )                     engfunc( EngFunc_RemoveEntity, ent );         }     }
__________________
Arkshine is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 11-13-2007 , 05:11   Re: Blocking spawned CSDM items
Reply With Quote #8

I load my plugins before the csdm ones.

I'm trying to prevent weaponpickup using the forward touch. Not deleting anything, just preventing it from being picked up for a specific team.
__________________
It's a mystery.
Mini_Midget is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-13-2007 , 14:21   Re: Blocking spawned CSDM items
Reply With Quote #9

As I've said above, you can't prevent by this way (Fm_Touch). It's not possible. May be there are others ways.
__________________
Arkshine is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 11-13-2007 , 19:51   Re: Blocking spawned CSDM items
Reply With Quote #10

im guessing csdm is detecting the touch before you are

try to put ur zombie plugin before csdm plugins
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow 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 01:13.


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