View Single Post
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 03-20-2020 , 07:40   Re: [REQ] Closed Hud Message By the player
Reply With Quote #2

I wrote by phone, that is, not tested and there may be errors.

PHP Code:
#include <amxmodx>

new bool:UserMsg[33]

new 
AdsCvarAdsHandler
public plugin_init()
{
    
register_clcmd("say /messagestop""MsgHandler")
    
AdsCvar register_cvar("ads_time""40")
}

public 
client_putinserver(id)
{
    if(!
is_user_bot(id))
    {
        
AdsHandler get_pcvar_num(AdsCvar)
        
UserMsg[id] = true
        CountDown
(id)
    }
}

public 
CountDown(id)
{
    if(!
UserMsg[id]) return 
    
    
AdsHandler --
    
    if(
AdsHandler 0)
    {
        
set_hudmessage(00255, -1.00.2906.040.0);
        
show_hudmessage(id"Welcom To Public Server^nAds: xxxx^nxxxxxx^nxxxxxx")
        
set_task(1.0"CountDown"id)
    }
    else
    {
        
remove_task(id)
    }
}

public 
MsgHandler(id)
{
    
UserMsg[id] = false
    
    client_print
(idprint_chat"You %s the ads."UserMsg[id] ? "enable" "disable")
    return 
PLUGIN_HANDLED

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 03-21-2020 at 17:09.
iceeedr is offline
Send a message via Skype™ to iceeedr