AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to delete buyzone? (https://forums.alliedmods.net/showthread.php?t=209512)

fl0werD 02-26-2013 12:37

How to delete buyzone?
 
How to delete buyzone?

This code is not work:
PHP Code:

public Forward__Spawn_Pre(iEntity)
{
    if(!
pev_valid(iEntity))
        return 
FMRES_IGNORED;

    new 
szClassName[32];
    
pev(iEntitypev_classnameszClassNamecharsmax(szClassName))

    if(!
equal(szClassName"func_buyzone") && !equal(szClassName"info_buyzone"))
        return 
FMRES_IGNORED;

    
engfunc(EngFunc_RemoveEntityiEntity)
    return 
FMRES_SUPERCEDE;


This code is work:
PHP Code:

public Message__StatusIcon(MsgIDMsgDestiPlayer)
{
    static 
szIcon[5];
    
get_msg_arg_string(2szIconcharsmax(szIcon))
     
    if(
szIcon[0] != 'b' || szIcon[2] != 'y' || szIcon[3] != 'z')
        return 
PLUGIN_CONTINUE;

    
set_pdata_int(iPlayer235get_pdata_int(iPlayer235) & ~(1<<0))
    return 
PLUGIN_HANDLED;


But I want remove buyzone to not use message status icon.

Bos93 02-26-2013 12:39

Re: How to delete buyzone?
 
http://forums.alliedmods.net/showpos...89&postcount=3

fl0werD 02-26-2013 12:41

Re: How to delete buyzone?
 
Quote:

Originally Posted by Bos93 (Post 1902406)

Thank you very much.

ConnorMcLeod 02-27-2013 00:45

Re: How to delete buyzone?
 
Better to alter existing entity, if exists.

PHP Code:

#include <amxmodx>
#include <engine>
#include <cstrike>

#define VERSION "0.0.1"
#define PLUGIN "No Buy"

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    new 
ClCmd_Buy[] = "ClCmd_Buy"
    
register_clcmd("buy"ClCmd_Buy)
    
register_clcmd("bUy"ClCmd_Buy)
    
register_clcmd("buY"ClCmd_Buy)
    
register_clcmd("bUY"ClCmd_Buy)
    
register_clcmd("Buy"ClCmd_Buy)
    
register_clcmd("BUy"ClCmd_Buy)
    
register_clcmd("BuY"ClCmd_Buy)
    
register_clcmd("BUY"ClCmd_Buy)

    new 
info_map_parameters[] = "info_map_parameters"
    
new iEnt find_ent_by_class(-1info_map_parameters)
    if( 
iEnt <= )
    {
        
iEnt create_entity(info_map_parameters)
    }

    
DispatchKeyValue(iEnt"buying""3")
    
DispatchSpawn(iEnt)

    
server_cmd("sv_restartround 1")
}

public 
ClCmd_Buyid )
{
    if( 
is_user_alive(id) )
    {
        if( 
cs_get_user_team(id) == CS_TEAM_T )
        {
            
client_print(idprint_center"#Cstrike_TitlesTXT_Terrorist_cant_buy")
        }
        else
        {
            
client_print(idprint_center"#Cstrike_TitlesTXT_CT_cant_buy")
        }
    }
    return 
PLUGIN_HANDLED_MAIN



fl0werD 02-27-2013 04:59

Re: How to delete buyzone?
 
And on metamod like better?

ConnorMcLeod 02-27-2013 13:16

Re: How to delete buyzone?
 
Nope, once entity is created/modified, no cpu is used anymore.

fl0werD 02-27-2013 14:36

Re: How to delete buyzone?
 
I don't use amxmodx...

bibu 02-27-2013 16:02

Re: How to delete buyzone?
 
Quote:

Originally Posted by fl0werD (Post 1903196)
I don't use amxmodx...



All times are GMT -4. The time now is 21:39.

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