View Single Post
TheiOne
Member
Join Date: Mar 2017
Old 05-11-2018 , 06:03   Re: Show a HUD message indefinitely
Reply With Quote #9

I did it like this:

Code:
public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_message(120, "join_spec");     register_event("DeathMsg", "deathmsg", "a"); } public client_putinserver(id) {     set_task(1.0, "showMessage", id, _, _, "b") } public join_spec(id) {     set_task(1.0, "showMessage", id, _, _, "b") } public deathmsg(id) {     set_task(1.0, "showMessage", id, _, _, "b") } public showMessage(id) {     if(!is_user_connected(id))     {         return;     }     else if(!is_user_alive(id))     {         set_dhudmessage(255, 255, 255, -1.0, 0.70, 0, 1.0, 1.0, 0.1, 0.2)         show_dhudmessage(id, "blah blah blah")     } }

It works, I just wanna know if I could make it better. Would there be any difference if I used a "get user team" in order to show the message when the player joins the SPEC or the current "register_message(120, "join_spec");" is OK ?

And I would appreciate it if someone could briefly explain the difference between hudmessage and dhudmessage. The obvious difference from the API is that dhudmessage has no channel parameter.

Thanks.
TheiOne is offline