Raised This Month: $ Target: $400
 0% 

ICON BIO


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
felipemilralze
Senior Member
Join Date: Jul 2011
Location: Brazil
Old 03-29-2017 , 14:28   ICON BIO
Reply With Quote #1

I wanted the icon to disappear when i open the menu because it disrupts the menu view, and if it exited the menu it appears again

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <zp50_gamemodes>

#define PLUGIN "Biohazard Icon"
#define VERSION "1.0"
#define AUTHOR "Zombie Lurker"

new iconstatus

new g_GameModeSurvivorID
g_GameModeNemesisID
g_GameModeMultiID
g_GameModeSwarmID
g_GameModePlagueID
g_GameModeInfectionID
g_GameModeArmageddon
g_GameModeAvsS

new icon[33]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_PlayerPreThink,"fw_prethink")
    
iconstatus get_user_msgid("StatusIcon")
    
register_clcmd("say /menu""menu")
}

public 
plugin_cfg()
{
    
g_GameModeNemesisID zp_gamemodes_get_id("Nemesis Mode")
    
g_GameModeSurvivorID zp_gamemodes_get_id("Survivor Mode")
    
g_GameModeSwarmID zp_gamemodes_get_id("Swarm Mode")
    
g_GameModePlagueID zp_gamemodes_get_id("Plague Mode")
    
g_GameModeInfectionID zp_gamemodes_get_id("Infection Mode")
    
g_GameModeMultiID zp_gamemodes_get_id("Multiple Infection Mode")
    
g_GameModeArmageddon zp_gamemodes_get_id("Armageddon Mode")
    
g_GameModeAvsS zp_gamemodes_get_id("Assassin vs Snipers Mode")
}

public 
fw_prethink(id
{
    if (
is_user_connected(id))     
    {
        if(
icon[id])
        {
            
icon[id] = true
            
            
if (zp_gamemodes_get_current() == g_GameModeNemesisID
            {
                 
set_user_icon(id 255 0)
            }
            
            else if (
zp_gamemodes_get_current() == g_GameModeSurvivorID
            {
                
set_user_icon(id 255)   
            }
            
            else if (
zp_gamemodes_get_current() == g_GameModeSwarmID
            {
                
set_user_icon(id 255 255 0)
            }
            
            else if (
zp_gamemodes_get_current() == g_GameModePlagueID
            {
                
set_user_icon(id 255 0)
            }
            
            else if (
zp_gamemodes_get_current() == g_GameModeInfectionID)
            {
                
set_user_icon(id 255 0)
            }
            
            else if (
zp_gamemodes_get_current() == g_GameModeMultiID)
            {
                
set_user_icon(id 255 0)
            }
            
            else if (
zp_gamemodes_get_current() == g_GameModeArmageddon)
            {
                
set_user_icon(id 200)
            }
            
            else if (
zp_gamemodes_get_current() == g_GameModeAvsS
            {
                
set_user_icon(id 100 0)
            }
        }
        
        if(!
icon[id])
        {
            
icon[id] = false
            set_user_icon
(id 0)
        }
    }
}

stock set_user_icon(idmoderedgreenblue
{
    
message_begin(MSG_ONEiconstatus, {0,0,0}, id)
    
write_byte(mode)
    
write_string("dmg_bio")
    
write_byte(red)
    
write_byte(green)
    
write_byte(blue)
    
message_end()
}


public 
menu(id)
{
    
icon[id] = !icon[id] ? true false
    
    
new menu menu_create("\rMenu:""menu_handler")
    
    
menu_additem(menu"\wTest""1")
    
menu_additem(menu"\wTest""2")
    
    
menu_setprop(menuMPROP_EXITNAME"\wExit")
    
// Fix for AMXX custom menus
    
set_pdata_int(idOFFSET_CSMENUCODE0)
    
menu_display(idmenu0)
    
    return 
PLUGIN_HANDLED
}

public 
menu_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64], accesscallback
    menu_item_getinfo
(menuitemaccessdata5iName63callback)
    
    switch (
str_to_num(data))
    {
        case 
1
        {
            
menu(id)
        }

        case 
2
        {
            
menu(id)
        }
    }
    
    return 
PLUGIN_HANDLED


Last edited by felipemilralze; 03-29-2017 at 14:53.
felipemilralze is offline
Send a message via MSN to felipemilralze Send a message via Skype™ to felipemilralze
 



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


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