Raised This Month: $ Target: $400
 0% 

Blocking spawned CSDM items


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-24-2007 , 07:06   Re: Blocking spawned CSDM items
Reply With Quote #1

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
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:12.


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