Raised This Month: $ Target: $400
 0% 

[REQ] Permanent HUD Message (Plugin Edit)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 07-27-2013 , 09:38   [REQ] Permanent HUD Message (Plugin Edit)
Reply With Quote #1

Hi everyone,
I have this plugin:
PHP Code:
#include <amxmodx>

#define PLUGIN "Under Construction"
#define VERSION "1.0"
#define AUTHOR "OxYgEn"

#define ADMIN_ACCESS ADMIN_BAN

new p_sm

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /sm""cmd_sm")
    
p_sm register_cvar("amx_sm""1")
}

public 
cmd_sm(id)
{
    if(
get_user_flags(id) & ADMIN_ACCESS && get_pcvar_num(p_sm) == 1)
    {
        
set_hudmessage(25500, -1.00.1906.012.0)
        
show_hudmessage(0"The server is under construction and may restart. Sorry for the inconvenience")
    }

I need 2 things to be edited:
1- Make the HUD Message (The server is under construction and may restart. Sorry for the inconvenience) to show as permanent (if possible)
2- Fix the CVar so when it's 1, it will show it permanently, and when 0, disable the permanent HUD Message
Any help will be appreciated
Thanks
JoooN is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 07-27-2013 , 10:43   Re: [REQ] Permanent HUD Message (Plugin Edit)
Reply With Quote #2

PHP Code:
#include <amxmodx>

#define PLUGIN    "Under Construction"
#define VERSION    "1.0"
#define AUTHOR    "OxYgEn & Shooting King"

#define ADMIN_ACCESS ADMIN_BAN
#define TASK_ID    94982

new p_smp_pmg_SyncObj;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /sm""cmd_sm")
    
p_sm register_cvar("amx_sm""1")
    
p_pm register_cvar("amx_sm_permanent""1")
    
    
g_SyncObj CreateHudSyncObj()
}

public 
cmd_sm(id)
{
    if(
get_user_flags(id) & ADMIN_ACCESS && get_pcvar_num(p_sm) == 1)
    {
        if(
get_pcvar_num(p_pm))
        {
            
show_hudmsg();
            
set_task12.0"show_hudmsg"TASK_ID__"b" ); 
        }
        else
        {
            
show_hudmsg();
            if(
task_exists(TASK_ID))
            {
                
remove_task(TASK_ID)
            }            
        }
    }
}

public 
show_hudmsg()
{
    
set_hudmessage(25500, -1.00.19__12.0__4)
    
ShowSyncHudMsg(0g_SyncObj"The server is under construction and may restart. Sorry for the inconvenience")

Plugin optimized.

Cvars:

amx_sm - As you know Default :1
amx_sm_permanent - Sets permanent message Default : 1

NOTE:
If you want to off permanent msg change cvar amx_sm_permanent to 0 and call /sm once.
Attached Files
File Type: sma Get Plugin or Get Source (uc_pmsg.sma - 540 views - 950 Bytes)
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here

Last edited by Shooting King; 07-27-2013 at 10:44.
Shooting King is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 07-27-2013 , 13:06   Re: [REQ] Permanent HUD Message (Plugin Edit)
Reply With Quote #3

Quote:
Originally Posted by Shooting King View Post
PHP Code:
#include <amxmodx>

#define PLUGIN    "Under Construction"
#define VERSION    "1.0"
#define AUTHOR    "OxYgEn & Shooting King"

#define ADMIN_ACCESS ADMIN_BAN
#define TASK_ID    94982

new p_smp_pmg_SyncObj;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /sm""cmd_sm")
    
p_sm register_cvar("amx_sm""1")
    
p_pm register_cvar("amx_sm_permanent""1")
    
    
g_SyncObj CreateHudSyncObj()
}

public 
cmd_sm(id)
{
    if(
get_user_flags(id) & ADMIN_ACCESS && get_pcvar_num(p_sm) == 1)
    {
        if(
get_pcvar_num(p_pm))
        {
            
show_hudmsg();
            
set_task12.0"show_hudmsg"TASK_ID__"b" ); 
        }
        else
        {
            
show_hudmsg();
            if(
task_exists(TASK_ID))
            {
                
remove_task(TASK_ID)
            }            
        }
    }
}

public 
show_hudmsg()
{
    
set_hudmessage(25500, -1.00.19__12.0__4)
    
ShowSyncHudMsg(0g_SyncObj"The server is under construction and may restart. Sorry for the inconvenience")

Plugin optimized.

Cvars:

amx_sm - As you know Default :1
amx_sm_permanent - Sets permanent message Default : 1

NOTE:
If you want to off permanent msg change cvar amx_sm_permanent to 0 and call /sm once.
Thanks
JoooN 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 00:15.


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