Raised This Month: $ Target: $400
 0% 

Solved multi bools


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 08-16-2019 , 12:26   Re: multi bools
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
Or you can declare the bool as "public" and retreive it via "get_xvar_num". But, yes, it's probably better to use natives.
other plugin does not read bool value when i change it in , Event_NewRound , client_putinserver , client_disconnected , etc. it only reads this :
PHP Code:
public bool:has_anti_bazooka[33
PHP Code:
/*
             Description :
                            An extra item that is made for zombies , which will reduce "Bazooka" damage.
*/

#include <amxmodx>
#include <zombieplague>

#if AMXX_VERSION_NUM < 183
#include <colorchat>
#define Red print_team_red
#define Blue print_team_blue
#define Grey print_team_grey
#define DontChange print_team_default
#endif

#define VERSION         "1.0"


new const NAME[] = "Anti-Bazooka"


new damage_reduce



new g_item


public bool:has_anti_bazooka[33]

public 
plugin_init()
{
    
register_plugin("Anti-Bazooka" VERSION "LearninG")
    

    
register_event("HLTV""Event_NewRound""a""1=0""2=0");
    

    
damage_reduce register_cvar("zp_anti_bazooka_damage_reduce" "300")
    

    
g_item zp_register_extra_item(NAME 25 ZP_TEAM_ZOMBIE)
}

public 
zp_extra_item_selected(playeritemid)
{

    if (
itemid == g_item && has_anti_bazooka[player])
    {
        return 
ZP_PLUGIN_HANDLED
    
}
    else if (
itemid == g_item && is_user_alive(player))
    {
        
client_print_color(playerprint_chat "^4[ZP]^1 You bought Anti-Bazooka! [%2.1f damage reduce]"get_pcvar_num(damage_reduce))
        
has_anti_bazooka[player] = true
    
}
    return 
PLUGIN_CONTINUE
}

public 
Event_NewRound()
{
    static 
players[32], numid
    get_players
(playersnum)
    for (new 
0numi++)
    {
        
id players[i]
        
has_anti_bazooka[id] = false
    
}
}

public 
client_disconnected(id)
{
    
has_anti_bazooka[id] = false
}

public 
client_putinserver(id)
{
    
has_anti_bazooka[id] = false

any suggestion ?
LearninG is offline
 



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:20.


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