This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Blocking spawned CSDM items


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 10-23-2007 , 07:25   Blocking spawned CSDM items
Reply With Quote #1

How do you block the spawned items from CSDM item mode?
All of them have the prefix "csdm" or if its a weapon. "csdmw_"
I want to block everything that is spawned from it.
Heres the list from the source
PHP Code:
new g_EntClass[][] = 
{
    
""
    
"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"

__________________
It's a mystery.
Mini_Midget is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 10-23-2007 , 23:12   Re: Blocking spawned CSDM items
Reply With Quote #2

what u trying to do?

y not remove the spawn items module / plugin
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 10-24-2007 , 06:15   Re: Blocking spawned CSDM items
Reply With Quote #3

I'm trying to block it from weapon pickup for a team.
I'm using the touch forward to do so but can't figure out how to do so.
__________________
It's a mystery.
Mini_Midget is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-24-2007 , 06:51   Re: Blocking spawned CSDM items
Reply With Quote #4

Get the player team and ent classname and do something like this.

Code:
Forward_Touch(Ent, id)
{
     static classname[32];
     pev(Ent, pev_classname, classname, sizeof classname - 1);
 
     for(new i = 0 ; i < sizeof g_EntClass ; i++)
     {
          if(equali(classname, g_EntClass[i]) && get_user_team(id) == 1)
          {
               return FMRES_SUPERCEDE;
          }
     }
     return FMRES_HANDLED;
}
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-24-2007 , 07:06   Re: Blocking spawned CSDM items
Reply With Quote #5

Check first if ent is a valid entity or you'll get some errors.
I also guess that the function has to be public, and that you should return FMRES_IGNORED, not FMRES_HANDLED, but i may be wrong on this last point.

Code:
public Forward_Touch(Ent, id) {     if(!is_user_alive(id) || !is_user_connected(id))         return FMRES_IGNORED;     if(!pev_valid(Ent)) {         return FMRES_IGNORED;     }     static classname[32];     pev(Ent, pev_classname, classname, sizeof classname - 1);     for(new i = 0 ; i < sizeof g_EntClass ; i++)     {         if(equali(classname, g_EntClass[i]) && get_user_team(id) == 1)         {             return FMRES_SUPERCEDE;         }     }     return return FMRES_IGNORED; }

You also may avoid using the native get_user_team checking player team offset.
ConnorMcLeod is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-24-2007 , 07:12   Re: Blocking spawned CSDM items
Reply With Quote #6

Meh...how you say...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 10-24-2007 , 07:43   Re: Blocking spawned CSDM items
Reply With Quote #7

Why doesn't this work? I tried doing this...
PHP Code:
public fw_Touch(touchedtoucher)
{
    if(!
get_pcvar_num(zomb_switch))
        return 
FMRES_IGNORED
    
    
if (!pev_valid(touched) || !is_user_connected(toucher) || !g_zombie[toucher])
        return 
FMRES_IGNORED

    
static classname[33]
    
pev(touchedpev_classnameclassname32)
    
    if ( ( 
classname[0] == 'w' && classname[1] == 'e' && classname[2] == 'a') || (classname[0] == 'a' && classname[1] == 'r' && classname[2] == 'm') || (classname[0] == 'c' && classname[1] == 's' && classname[2] == 'd' ) )
        return 
FMRES_SUPERCEDE
    
    
return FMRES_IGNORED

wea is for weaponbox and weapon_shield
arm is for armory_entity
csd is for the csdm spawned items
__________________
It's a mystery.
Mini_Midget is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-24-2007 , 08:01   Re: Blocking spawned CSDM items
Reply With Quote #8

try to replace last FMRES_IGNORED with FMRES_HANDLED :/

Edit:I don't think will work. Should be FMRES_IGNORED but , you'r example should work :s

Try to use equali(classname[0], "w")) and so...instead of classname[0] == 'w'
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 10-24-2007 at 08:04.
Alka is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-24-2007 , 08:13   Re: Blocking spawned CSDM items
Reply With Quote #9

I assume you have registered the forward in plugin_init ?

Code:
register_forward(FM_Touch,"fw_Touch")
ConnorMcLeod is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 10-24-2007 , 09:44   Re: Blocking spawned CSDM items
Reply With Quote #10

use {} ?
yes he declared touch
__________________
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 04:06.


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