Raised This Month: $27 Target: $400
 6% 

[REQ] Closed Hud Message By the player


Post New Thread Reply   
 
Thread Tools Display Modes
alferd
Senior Member
Join Date: Dec 2019
Old 03-22-2020 , 04:42   Re: [REQ] Closed Hud Message By the player
Reply With Quote #11

Quote:
Originally Posted by iceeedr View Post
Code revised and working now, please test.
It still didn't work
alferd is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 03-22-2020 , 10:32   Re: [REQ] Closed Hud Message By the player
Reply With Quote #12

Quote:
Originally Posted by alferd View Post
It still didn't work
I tested again, and it works. See if there are any errors in the logs folder because everything is working perfectly here.
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
alferd
Senior Member
Join Date: Dec 2019
Old 03-22-2020 , 11:36   Re: [REQ] Closed Hud Message By the player
Reply With Quote #13

a_hud2.amxx debug

Code:
L 03/22/2020 - 08:30:15: Function "countDown" was not found
L 03/22/2020 - 08:30:15: [AMXX] Displaying debug trace (plugin "a_hud2.amxx")
L 03/22/2020 - 08:30:15: [AMXX] Run time error 19: function not found 
L 03/22/2020 - 08:30:15: [AMXX]    [0] a_hud2.sma::plugin_init (line 16)
This has nothing to do with not working
it's true?
alferd is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 03-22-2020 , 11:40   Re: [REQ] Closed Hud Message By the player
Reply With Quote #14

Quote:
Originally Posted by alferd View Post
a_hud2.amxx debug

Code:
L 03/22/2020 - 08:30:15: Function "countDown" was not found
L 03/22/2020 - 08:30:15: [AMXX] Displaying debug trace (plugin "a_hud2.amxx")
L 03/22/2020 - 08:30:15: [AMXX] Run time error 19: function not found 
L 03/22/2020 - 08:30:15: [AMXX]    [0] a_hud2.sma::plugin_init (line 16)
This has nothing to do with not working
it's true?
Copy his code again, recompile it and reinstall it. There's something you're doing wrong. Don't just go and change capital letters into small ones. If it says "CountDown", leave it be and don't change it to "countDown". Especially when u don't know what you're doing.
__________________

Last edited by Napoleon_be; 03-22-2020 at 11:41.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
alferd
Senior Member
Join Date: Dec 2019
Old 03-24-2020 , 04:28   Re: [REQ] Closed Hud Message By the player
Reply With Quote #15

Quote:
Originally Posted by iceeedr View Post
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

Disables after the end of time
I want to disable it immediately when typing (say /messagestop)
alferd is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 03-24-2020 , 08:07   Re: [REQ] Closed Hud Message By the player
Reply With Quote #16

I already gave you a code that do this, i really don't understand hahaha
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
Reply


Thread Tools
Display Modes

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 22:34.


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