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

CHalfLifeMultiplay::CanPlayerBuy


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 12-17-2018 , 07:36   CHalfLifeMultiplay::CanPlayerBuy
Reply With Quote #1

Hello, I'm trying to remove player access to the buy menu. What I did was work with m_bCTCantBuy and m_bTCantBuy (CHalfLifeMultiplay::CanPlayerBuy), but didn't work.


Code:
public plugin_init() {     register_plugin("Something", "1.0", "Crazy");         set_gamerules_int("CHalfLifeMultiplay", "m_bCTCantBuy", true);     set_gamerules_int("CHalfLifeMultiplay", "m_bTCantBuy", true); }

I know is there a trick that you can do with StatusIcon, but I would to know why the members way isn't working.
__________________









Last edited by CrazY.; 12-17-2018 at 07:38.
CrazY. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-17-2018 , 10:24   Re: CHalfLifeMultiplay::CanPlayerBuy
Reply With Quote #2

CHalfLifeMultiplay::RestartRound(new round) -> CheckMapInfo -> m_bCTCantBuy and m_bTCantBuy are changed based on m_iBuyingStatus.
PHP Code:
CSGameRules()->m_bCTCantBuy bCTCantBuy;
CSGameRules()->m_bTCantBuy bTCantBuy
Your change from plugin_init is overwritten.
__________________

Last edited by HamletEagle; 12-17-2018 at 10:25.
HamletEagle is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 12-17-2018 , 10:48   Re: CHalfLifeMultiplay::CanPlayerBuy
Reply With Quote #3

You can create info_map_parameters entity or edit it if it already exists on the map.
__________________
My English is A0
E1_531G is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 12-17-2018 , 12:44   Re: CHalfLifeMultiplay::CanPlayerBuy
Reply With Quote #4

Weird, if I do that with ReAPI the members it's not redefined. Anyway, I tried with info_map_parameters but isn't working. I will opt for StatusIcon, it looks the most properly way.
__________________









Last edited by CrazY.; 12-17-2018 at 12:45.
CrazY. is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 12-17-2018 , 13:17   Re: CHalfLifeMultiplay::CanPlayerBuy
Reply With Quote #5

Quote:
Originally Posted by CrazY. View Post
Anyway, I tried with info_map_parameters but isn't working.
plugin_precache():
PHP Code:
new iEnt create_entity"info_map_parameters" );
DispatchKeyValueiEnt"buying""3" );
DispatchSpawniEnt ); 
Does it work?
__________________
My English is A0
E1_531G is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 12-17-2018 , 18:57   Re: CHalfLifeMultiplay::CanPlayerBuy
Reply With Quote #6

I noticed that it block from buy but menu it's being shown, so I'll still opt for StatusIcon way.
__________________








CrazY. 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 14:51.


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