Raised This Month: $12 Target: $400
 3% 

Blocking Buy Commands (Basic)


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-27-2013 , 18:12   Re: Blocking Buy Commands (Basic)
Reply With Quote #41

client_infochanged is a pre forward, it makes sense pdata would be overwritten since original code has not been executed yet.
Hook such forward as post.
__________________

Last edited by Arkshine; 06-27-2013 at 18:12.
Arkshine is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 06-27-2013 , 18:20   Re: Blocking Buy Commands (Basic)
Reply With Quote #42

PHP Code:
register_forward(FM_ClientUserInfoChanged"fwClientUserInfoChanged"1)

public 
fwClientUserInfoChanged(id)
{
    if( 
is_user_connected(id) )
    
set_pdata_bool(id2040false )

doesn't work.
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-28-2013 , 00:32   Re: Blocking Buy Commands (Basic)
Reply With Quote #43

Quote:
Originally Posted by Arkshine View Post
client_infochanged is a pre forward, it makes sense pdata would be overwritten since original code has not been executed yet.
Hook such forward as post.
Drunkshine.


Quote:
Originally Posted by Bos93 View Post
PHP Code:
register_forward(FM_ClientUserInfoChanged"fwClientUserInfoChanged"1)

public 
fwClientUserInfoChanged(id)
{
    if( 
is_user_connected(id) )
    
set_pdata_bool(id2040false )

doesn't work.
This is weird, anyway, you can do the same in client_infochanged, better.

[edit] buy is proceeded client side, so, setting pdata or using set_user_info won't work, and you are not allowed to use client_cmd.
So you have to hook buy commands, see my previous link.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 06-28-2013 at 00:43.
ConnorMcLeod is offline
President
Member
Join Date: May 2013
Old 06-30-2013 , 15:40   Re: Blocking Buy Commands (Basic)
Reply With Quote #44

What about this way:
Quote:
Originally Posted by nnajko View Post
PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_cfg() 

    
register_message(get_user_msgid("StatusIcon"), "Message_StatusIcon");
}

public 
Message_StatusIcon(iMsgIdiMsgDestid

    static 
szIcon[8]; 
    
get_msg_arg_string(2szIconcharsmax(szIcon)); 
    if( 
equal(szIcon"buyzone") )
    { 
        if( 
get_msg_arg_int(1) ) 
        { 
            
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0));
            return 
PLUGIN_HANDLED
        } 
    } 
     
    return 
PLUGIN_CONTINUE

Is it efficient?

Last edited by President; 07-01-2013 at 10:24.
President is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 06-30-2013 , 16:12   Re: Blocking Buy Commands (Basic)
Reply With Quote #45

What? Buy command doesn't will be called
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
President
Member
Join Date: May 2013
Old 07-01-2013 , 10:24   Re: Blocking Buy Commands (Basic)
Reply With Quote #46

I didn't understand what you said

Quote:
Originally Posted by Bos93 View Post
doesn't will
Interesting
President is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 07-01-2013 , 10:27   Re: Blocking Buy Commands (Basic)
Reply With Quote #47

I do not know English

^
- buy command doesn't called with your code
__________________

Last edited by Bos93; 07-01-2013 at 10:28.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-01-2013 , 15:22   Re: Blocking Buy Commands (Basic)
Reply With Quote #48

See the CSDM to know how to block buy zones its more easy LOL
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Reply


Thread Tools
Display Modes

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 06:30.


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