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

[Solved] Completely hide buyzone icon.


Post New Thread Reply   
 
Thread Tools Display Modes
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 09-08-2014 , 11:54   Re: [Help] Completely hide buyzone icon.
Reply With Quote #11

yeah I haven't really done this, I just took my code for removing bomb sites, hostage rescue sites and so on and implemented func_buyzone into it

I still think status icon is the best way
__________________
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 , 12:45   Re: [Help] Completely hide buyzone icon.
Reply With Quote #12

To completely block buy i already did it by Orpheu, but i need to remove that silly buyzone icon.

I found a code by jim_yang:
Code:
  //patch StatusIcon "buyzone" color green from 160 to 0
  patch_mem_data<int>(GETREALADDR(0x535FE), 0);
  patch_mem_data<int>(GETREALADDR(0x618D4), 0);
  patch_mem_data<int>(GETREALADDR(0x619C1), 0);
__________________
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
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-08-2014 , 12:51   Re: [Help] Completely hide buyzone icon.
Reply With Quote #13

Quote:
Originally Posted by yokomo View Post
To completely block buy i already did it by Orpheu, but i need to remove that silly buyzone icon.

I found a code by jim_yang:
Code:
  //patch StatusIcon "buyzone" color green from 160 to 0
  patch_mem_data<int>(GETREALADDR(0x535FE), 0);
  patch_mem_data<int>(GETREALADDR(0x618D4), 0);
  patch_mem_data<int>(GETREALADDR(0x619C1), 0);
Share with us the orpheu code
__________________
HamletEagle is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 09-08-2014 , 13:04   Re: [Help] Completely hide buyzone icon.
Reply With Quote #14

Plugin


Signatures:
CanBuyThis


BuyItem


BuyGunAmmo


Not sure signature work or not in current hlds, i'm using 5787 Linux.
__________________
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
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 09-08-2014 , 19:06   Re: [Help] Completely hide buyzone icon.
Reply With Quote #15

info_map_parameters
buying "3"

Spawn this in plugin_precache, see if it works.
If it is then it is the most effective way
.Dare Devil. is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-09-2014 , 03:37   Re: [Help] Completely hide buyzone icon.
Reply With Quote #16

Basically, StatusIcon with "buyzone" is checkd/updated in CBasePlayer::HandleSignals, which is called each 0.5 second from CBasePlayer::UpdateClientData (by the way, using a member m_tmHandleSignals).

If you don't have a buy zone (func_buyzone entity), game will check if you are in a range (< 200u) of a spawn point.

Best way to hide the icon without too much code is probably to spawn a func_buyzone entity (if not already) and to set its origin to high place, or make entity not solid so you can't touch and trigger a buy signal.

To block buying, info_map_parameters is the easy and fast way but you will get a message. If you're using 1.8.3, you can use CS_OnBuyAttempt forward and returning PLUGIN_HANDLED.
__________________

Last edited by Arkshine; 09-09-2014 at 03:37.
Arkshine is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 09-09-2014 , 07:17   Re: [Help] Completely hide buyzone icon.
Reply With Quote #17

Quote:
Originally Posted by Arkshine View Post
Basically, StatusIcon with "buyzone" is checkd/updated in CBasePlayer::HandleSignals, which is called each 0.5 second from CBasePlayer::UpdateClientData (by the way, using a member m_tmHandleSignals).

If you don't have a buy zone (func_buyzone entity), game will check if you are in a range (< 200u) of a spawn point.

Best way to hide the icon without too much code is probably to spawn a func_buyzone entity (if not already) and to set its origin to high place, or make entity not solid so you can't touch and trigger a buy signal.

To block buying, info_map_parameters is the easy and fast way but you will get a message. If you're using 1.8.3, you can use CS_OnBuyAttempt forward and returning PLUGIN_HANDLED.
Nice! it works..
Code
__________________
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
Old 09-09-2014, 08:19
HamletEagle
This message has been deleted by HamletEagle.
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 09-09-2014 , 08:26   Re: [Help] Completely hide buyzone icon.
Reply With Quote #18

Quote:
Originally Posted by HamletEagle View Post
In IsFuncBuyZoneExist, you should break the while loop.
Reason? does func_buyzone only created once in a map? If more than 1 then i don't need to add "break".
__________________
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
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-09-2014 , 08:29   Re: [Help] Completely hide buyzone icon.
Reply With Quote #19

That's the idea yokomo, though I don't like duplicated code, and I think this should be a better place to do this in plugin_init to make sure map entity is spawned.

Probably something like:
Spoiler

or maybe like this to avoid to hardcode:
Spoiler


Actually you could remove any "func_buyzone" and then creating one. The less entities, the better probably.
Spoiler
__________________

Last edited by Arkshine; 09-09-2014 at 08:34.
Arkshine is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 09-09-2014 , 09:56   Re: [Help] Completely hide buyzone icon.
Reply With Quote #20

Hey Arkshine, how can I remove/hide the money and the round timer with this method ?
Lolz0r 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 15:35.


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