Raised This Month: $ Target: $400
 0% 

Prevent func_buyzone creating


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 05-27-2010 , 05:44   Prevent func_buyzone creating
Reply With Quote #1

How to hook & prevent func_buyzone creating?

This doesn't work
PHP Code:
public plugin_precache()
    
g_fwSpawn register_forward(FM_Spawn"fw_Spawn");
    
// Entity Spawn Forward
public fw_Spawn(entity)
{
    
// Invalid entity
    
if (!pev_valid(entity)) return FMRES_IGNORED;
    
    
// Get classname
    
new Classname[32];
    
pev(entitypev_classnameClassnamesizeof Classname 1);
    
    
server_print("%s",Classname);
    
    if (
equal(Classname,"func_buyzone"))
    {
                       
// was never hooked
        
server_print("gg");
        
engfunc(EngFunc_RemoveEntityentity);
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

PHP Code:
public plugin_precache()
    
register_forward(FM_KeyValue"Forward_KeyValue_Post"1);

public 
Forward_KeyValue_Post(entkvd_handle)
{   
    if (
pev_valid(ent))
    {
        new 
classname[32];
        
get_kvd(kvd_handleKV_ClassNameclassname31);
        
//server_print("KVD: %s",classname);
        
        
if (equal(classname"func_buyzone"))
        {
                                  
//was never hooked"
            
server_print("YESSS");
            if(
pev_valid(ent))
                
engfunc(EngFunc_RemoveEntityent);
        }
    } 
    return 
PLUGIN_CONTINUE;


Last edited by Empowers; 05-27-2010 at 05:56.
Empowers is offline
Send a message via ICQ to Empowers
 



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 05:18.


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