Raised This Month: $32 Target: $400
 8% 

What's the best way to show this message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blood2k
Senior Member
Join Date: Mar 2014
Old 07-21-2018 , 13:52   What's the best way to show this message
Reply With Quote #1

I'm using the below dhudmessage, and I'm trying to make a plugin that shows my messages to dead players who have the admin flag "A" only. But I don't want it to show every time a person dies, just like every 5 minutes to all dead players at that time.

Could anyone help, here's the code of course..

Code:
#include <amxmodx>
#include <dhudmessage>

public plugin_init()
{
    register_plugin( "Test", "", "" );

}

public ClientCommand_Test( client )
{
    set_dhudmessage( 0, 160, 0, -1.0, 0.25, 2, 6.0, 3.0, 0.1, 1.5 );
    show_dhudmessage( client, "Join our forum." );
	show_dhudmessage( client, "Website." );
	show_dhudmessage( client, ":)" );
    
}
blood2k is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-21-2018 , 13:54   Re: What's the best way to show this message
Reply With Quote #2

Use a set_task() for 5 minutes.
__________________
fysiks is offline
blood2k
Senior Member
Join Date: Mar 2014
Old 07-21-2018 , 13:56   Re: What's the best way to show this message
Reply With Quote #3

well actually to be more exact.... is it possible to just call this to all players who spawn for the first time? This would be ideal. I know I could call it on playerspawn, but how to call on players first spawn? I know it's out there in a plugin somewhere.. but my google results aren't coming up with it lol so figured i'd ask some1 to just give me the on player first spawn command
blood2k is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-21-2018 , 14:03   Re: What's the best way to show this message
Reply With Quote #4

Quote:
Originally Posted by blood2k View Post
well actually to be more exact.... is it possible to just call this to all players who spawn for the first time? This would be ideal. I know I could call it on playerspawn, but how to call on players first spawn? I know it's out there in a plugin somewhere.. but my google results aren't coming up with it lol so figured i'd ask some1 to just give me the on player first spawn command
Why not just show on client_putinserver?
Anyways, to get first spawn, create a global bool g_bSpawns[33], hook Ham_Spawn and increase g_bSpawns[id]++ , then check if(g_bSpawns[id] == 1).
__________________
edon1337 is offline
blood2k
Senior Member
Join Date: Mar 2014
Old 07-21-2018 , 14:18   Re: What's the best way to show this message
Reply With Quote #5

does clientputinserver support using "client" instead of "id" when addressing who sees it? I'm not good with this stuff at all.. so if you could help post up a code that'd be cool too
blood2k is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-21-2018 , 14:23   Re: What's the best way to show this message
Reply With Quote #6

client_putinserver only has 1 parameter, which is the player index, you can name it whatever you want. Same with Ham_Spawn. You can the parameters however you'd like.
To answer your question in simple words, yes client=id in your case.
__________________

Last edited by edon1337; 07-21-2018 at 14:23.
edon1337 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-21-2018 , 14:24   Re: What's the best way to show this message
Reply With Quote #7

Quote:
Originally Posted by blood2k View Post
does clientputinserver support using "client" instead of "id" when addressing who sees it? I'm not good with this stuff at all.. so if you could help post up a code that'd be cool too
You can call the variable whatever you want, it doesn't matter, it's the same thing.
__________________
fysiks is offline
blood2k
Senior Member
Join Date: Mar 2014
Old 07-21-2018 , 14:35   Re: What's the best way to show this message
Reply With Quote #8

Strange.. I put it on client putinserver and it's not showing anything to me. I replaced ID with client. Hmm does client putinserver not work in lan single player? That's usually how i test it

Last edited by blood2k; 07-21-2018 at 14:42.
blood2k is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-21-2018 , 14:50   Re: What's the best way to show this message
Reply With Quote #9

Quote:
Originally Posted by blood2k View Post
Strange.. I put it on client putinserver and it's not showing anything to me. I replaced ID with client. Hmm does client putinserver not work in lan single player? That's usually how i test it
Put a little delay to it, like 3 seconds or so.
__________________
edon1337 is offline
blood2k
Senior Member
Join Date: Mar 2014
Old 07-21-2018 , 18:24   Re: What's the best way to show this message
Reply With Quote #10

So I would need a set task for that? Can I achieve this without a task? Does client putinserver mean they're on a team already? Or just joined and can still be unassigned
blood2k 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 16:08.


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