AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Prevent func_buyzone creating (https://forums.alliedmods.net/showthread.php?t=127968)

Empowers 05-27-2010 05:44

Prevent func_buyzone creating
 
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;



Brreaker 05-27-2010 06:02

Re: Prevent func_buyzone creating
 
Read this:
http://forums.alliedmods.net/showthr...t=func_buyzone

Empowers 05-27-2010 06:22

Re: Prevent func_buyzone creating
 
Thx man solved =)


All times are GMT -4. The time now is 05:18.

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