View Single Post
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-28-2014 , 09:28   Re: You won't kill hostages anymore
Reply With Quote #8

Quote:
Originally Posted by red_bull2oo6 View Post
PHP Code:
public plugin_cfg ( ) {
    
    
    if ( 
get_pcvar_num Cvars [  CVAR_STATUS ] ) == ) {
        
        
log_amx "Plugin paused" )
        
pause "a" )
        
    }
    

what happens if server starts with the cvar value 0 than i want to change it to 1.
for example i want it always deactivated and only when i need/want, to activate it.

i think you could return FMRES_IGNORED; in TraceAttack forward if the cvar is 0.


also i saw this ( you always declare a new variable to use it in one switch.. )

PHP Code:
new iNum random_num )    
switch ( 
iNum ) {
    
-->
    
switch ( 
random_num ) ) { 
1. Cvar is default 1, no problem in this.
2. FMRES_INGORED in a ham forward ? Are you serious ? Anyway, it's better to pause it, we avoid that some code to execute when it shouldn't.
3. Where do you saw that "I always declare a new variable to use it in one switch" ? But, you are right here, updated.

Edit: fw is not a fakemeta tag. I understand what you want to say with plugin_cfg but it's ok, because it will be auto-disabled on non-hostage maps, you don't need to care to activate/deactivate it and you have no reason to keep the cvar to 0 if you want to run it into current map.

Last edited by HamletEagle; 06-28-2014 at 09:47.
HamletEagle is offline