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

[SOLVED] Enabling Buy Zone.


Post New Thread Reply   
 
Thread Tools Display Modes
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 11-26-2016 , 14:17   Re: Enabling Buy Zone.
Reply With Quote #11

Those entities that reappear on new round are not removed but just hidden instead (func_breakable and armoury_entity come to mind).
Once you remove an entity it will be gone until the map change (unless there are some exceptions that I can't think of right now).

Just altering StatusIcon message under certain circumstances should be enough I guess.
klippy is offline
abhishek_deshkar
Senior Member
Join Date: Jun 2013
Location: Earth
Old 11-26-2016 , 15:32   Re: Enabling Buy Zone.
Reply With Quote #12

Quote:
Originally Posted by KliPPy View Post
Those entities that reappear on new round are not removed but just hidden instead (func_breakable and armoury_entity come to mind).
Once you remove an entity it will be gone until the map change (unless there are some exceptions that I can't think of right now).

Just altering StatusIcon message under certain circumstances should be enough I guess.
What changes should I do in my code to disable buy in specific round ?
abhishek_deshkar is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 11-26-2016 , 18:10   Re: Enabling Buy Zone.
Reply With Quote #13

i'm also interested, kilppy this is cleary to much for the author (as for me .. ), can you make the code if you have time?

Thanks!
__________________
Project: Among Us

Last edited by Craxor; 11-26-2016 at 18:10.
Craxor is offline
Send a message via ICQ to Craxor
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-26-2016 , 18:35   Re: Enabling Buy Zone.
Reply With Quote #14

How about something like this? After disabling and you want to re-enable next round, just set a bool when disabled and at new round event, if bool is true then call the enable function.
PHP Code:
#include <amxmodx>
#include <engine>

new g_BuyZone];

public 
plugin_init() 
{
    
g_BuyZone] = find_ent_by_class( -"func_buyzone" );
    
g_BuyZone] = find_ent_by_classg_BuyZone] , "func_buyzone" );
    
    
register_clcmd"say disable" "DisableBuyzones" );
    
register_clcmd"say enable" "EnableBuyzones" );
}

public 
DisableBuyzonesid )
{
    
entity_set_intg_BuyZone] , EV_INT_solid SOLID_NOT );
    
entity_set_intg_BuyZone] , EV_INT_solid SOLID_NOT );
}

public 
EnableBuyzonesid )
{
    
entity_set_intg_BuyZone] , EV_INT_solid SOLID_TRIGGER );
    
entity_set_intg_BuyZone] , EV_INT_solid SOLID_TRIGGER );

__________________

Last edited by Bugsy; 11-26-2016 at 18:36.
Bugsy is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 11-26-2016 , 18:57   Re: Enabling Buy Zone.
Reply With Quote #15

ok i understand the whole code bugsy, but i have a question:

enfwaf..._set_int( g_BuyZone[ 1 ] , EV_INT_solid , SOLID_NOT );

Here where you supose to disable you make the entity SOLID and on enable you make it TRIGGER ?
Trigger mean you can shot it, you can use ? and SOLD_NOT mean a kind of 'disabled' or what? because after it's name i can just understand ' IS NOT SOLID ' wich is non-sense ..
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-26-2016 , 19:09   Re: Enabling Buy Zone.
Reply With Quote #16

Quote:
Originally Posted by Craxor View Post
ok i understand the whole code bugsy, but i have a question:

enfwaf..._set_int( g_BuyZone[ 1 ] , EV_INT_solid , SOLID_NOT );

Here where you supose to disable you make the entity SOLID and on enable you make it TRIGGER ?
Trigger mean you can shot it, you can use ? and SOLD_NOT mean a kind of 'disabled' or what? because after it's name i can just understand ' IS NOT SOLID ' wich is non-sense ..
hlsdk_const
Code:
#define SOLID_NOT                       0           // No interaction with other objects
#define SOLID_TRIGGER                   1           // Touch on edge, but not blocking
I use this same method in my Bomb Site Lock plugin to enable/disable bomb sites.
__________________
Bugsy is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 11-26-2016 , 19:15   Re: Enabling Buy Zone.
Reply With Quote #17

But Bugsy, map doesn't have to contain a func_buyzone entity. In that case, areas nearby spawn points are used as buyzones I think.
klippy is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 11-26-2016 , 19:27   Re: Enabling Buy Zone.
Reply With Quote #18

ok but you still can see it ( buyzone ent are invizibile, i'm talking about hostages ).

Because you don't remove it, you make it NON-SOLID ( no interaction, touching ), so, that's mean you can't touch/use it, but you can see it ? Your code deactivate also the buy icon ?
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-26-2016 , 19:55   Re: Enabling Buy Zone.
Reply With Quote #19

@Klippy : I am not sure.
@craxor : Yes, cart icon hides when disabled and reappears when enabled.
__________________
Bugsy is offline
abhishek_deshkar
Senior Member
Join Date: Jun 2013
Location: Earth
Old 11-27-2016 , 00:07   Re: Enabling Buy Zone.
Reply With Quote #20

Quote:
Originally Posted by Bugsy View Post
How about something like this? After disabling and you want to re-enable next round, just set a bool when disabled and at new round event, if bool is true then call the enable function.
PHP Code:
#include <amxmodx>
#include <engine>

new g_BuyZone];

public 
plugin_init() 
{
    
g_BuyZone] = find_ent_by_class( -"func_buyzone" );
    
g_BuyZone] = find_ent_by_classg_BuyZone] , "func_buyzone" );
    
    
register_clcmd"say disable" "DisableBuyzones" );
    
register_clcmd"say enable" "EnableBuyzones" );
}

public 
DisableBuyzonesid )
{
    
entity_set_intg_BuyZone] , EV_INT_solid SOLID_NOT );
    
entity_set_intg_BuyZone] , EV_INT_solid SOLID_NOT );
}

public 
EnableBuyzonesid )
{
    
entity_set_intg_BuyZone] , EV_INT_solid SOLID_TRIGGER );
    
entity_set_intg_BuyZone] , EV_INT_solid SOLID_TRIGGER );

Thank you so much sir
abhishek_deshkar 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 11:37.


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