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

[Solved] Completely hide buyzone icon.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 09-08-2014 , 08:33   [Solved] Completely hide buyzone icon.
Reply With Quote #1

Hi, i found this code:
PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
    
register_plugin("Sekat Zon Beli-belah""0.0.1""wbyokomo")
    
register_message(get_user_msgid("StatusIcon"), "OnStatusIcon")
}

public 
OnStatusIcon(msgidmsgdestid
{  
    static 
szMsg[8]; get_msg_arg_string(2szMsg7);
    if(
equal(szMsg"buyzone") && get_msg_arg_int(1)) 
    {
        
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0))
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;

This code will hide buyzone from appear, but any other efficient method to hide buyzone? I mean using Orpheu.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 09-09-2014 at 10:22. Reason: Problem solved, see https://forums.alliedmods.net/showpost.php?p=2195827&postcount=21
yokomo is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-08-2014 , 08:38   Re: [Help] Completely hide buyzone icon.
Reply With Quote #2

LOL, "Sekat Zon Beli-belah".

By the way, in English:
Quote:
Restrict the Buy Zone.
Please don't angry with me. ;)
zmd94 is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 09-08-2014 , 08:46   Re: [Help] Completely hide buyzone icon.
Reply With Quote #3

Quote:
Originally Posted by zmd94 View Post
LOL, "Sekat Zon Beli-belah".

By the way, in English:
Please don't angry with me. ;)
Haha. Ok.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 09-08-2014 , 08:47   Re: [Help] Completely hide buyzone icon.
Reply With Quote #4

what exactly do you want
just to hide the icon or remove buyzone?
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-08-2014 , 09:51   Re: [Help] Completely hide buyzone icon.
Reply With Quote #5

He wants to do what his actual code do, but with orpheu( to hide the icon ). Why you need orpheu for a simple thing like this ? I mean, why not using it as it is ?
__________________

Last edited by HamletEagle; 09-08-2014 at 09:52.
HamletEagle is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 09-08-2014 , 09:58   Re: [Help] Completely hide buyzone icon.
Reply With Quote #6

Quote:
Originally Posted by HamletEagle View Post
He wants to do what his actual code do, but with orpheu( to hide the icon ). Why you need orpheu for a simple thing like this ? I mean, why not using it as it is ?
Do you think the code i posted above efficient? Because it will call every time StatusIcon message were sent.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 09-08-2014 , 10:03   Re: [Help] Completely hide buyzone icon.
Reply With Quote #7

Quote:
Originally Posted by yokomo View Post
Do you think the code i posted above efficient? Because it will call every time StatusIcon message were sent.
that's how often cs sends the icon anyways without your plugin, so I guess it's nothing inefficient
by my logic tho, may be incorrect
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 09-08-2014 , 10:11   Re: [Help] Completely hide buyzone icon.
Reply With Quote #8

I tested with this code:
PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
    
register_plugin("Sekat Zon Beli-belah""0.0.1""wbyokomo")
    
register_message(get_user_msgid("StatusIcon"), "OnStatusIcon")
}

public 
OnStatusIcon(msgidmsgdestid
{  
    static 
szMsg[8]; get_msg_arg_string(2szMsg7);
    if(
equal(szMsg"buyzone") && get_msg_arg_int(1)) 
    {
        
server_print("Hook Called: OnStatusIcon(msgid, msgdest, id)")
        
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0))
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;

You stand in buyzone and see your hlds console, it called every ~0.4 seconds. I'm thinking.. how about we move the buyzone origin? set it origin outside of map so player can't reach/touch it.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 09-08-2014 , 11:31   Re: [Help] Completely hide buyzone icon.
Reply With Quote #9

Quote:
Originally Posted by yokomo View Post
I tested with this code:
PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
    
register_plugin("Sekat Zon Beli-belah""0.0.1""wbyokomo")
    
register_message(get_user_msgid("StatusIcon"), "OnStatusIcon")
}

public 
OnStatusIcon(msgidmsgdestid
{  
    static 
szMsg[8]; get_msg_arg_string(2szMsg7);
    if(
equal(szMsg"buyzone") && get_msg_arg_int(1)) 
    {
        
server_print("Hook Called: OnStatusIcon(msgid, msgdest, id)")
        
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0))
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;

You stand in buyzone and see your hlds console, it called every ~0.4 seconds. I'm thinking.. how about we move the buyzone origin? set it origin outside of map so player can't reach/touch it.
that's why I was asking what you want to do, remove shop icon or remove buyzone completely
PHP Code:
register_forward(FM_Spawn"precache_spawn"1)


public 
precache_spawn(ent)
{
if(
is_valid_ent(ent))
    {
        static 
szClass[33]
        
entity_get_string(entEV_SZ_classnameszClasssizeof(szClass))
            if(
equal(szClass"func_buyzone"))
                
remove_entity(ent)
    }

This should do the trick
untested tho
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.

Last edited by aron9forever; 09-08-2014 at 11:31.
aron9forever is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-08-2014 , 11:50   Re: [Help] Completely hide buyzone icon.
Reply With Quote #10

  • Even if you remove buyzone, players can still buy items, the game still knows that there is a buyzone.
  • Also, your way is not the best for removing a buyzone.
  • Spoiler
  • You still need to block buy commands.
  • Another ideea is to simply block the touch with the buyzone( register_touch( "func_buy_zone", "player", "CBasePlayer_Touch" ) ) ( I didn't ever try this, so idk if it will work, better to just use the snippet above ).
__________________

Last edited by HamletEagle; 09-08-2014 at 12:10.
HamletEagle 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 17:09.


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