How to show hud to individual players
I can't remember how to get the user id in a plugin for example:
set_hudmessage(255, 0, 0, 0.95, 0.01, 0, 0.1, 0.9, 0.1, 0.1, -1) show_hudmessage(0 , "Time: %s ",time) This makes part of a plugin that shows time but when you type the command the hud gets activated for everyone because it's set to 0 and I know for a fact that you can use the individual user id's to show it only to the player that types a certain command can someone remind it to me please? thx a lot :) |
Re: How to show hud to individual players
Show the full code, most likely the player id is in the function parameters.
|
Re: How to show hud to individual players
Quote:
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /thetime","The_time",0,"Arata ora") register_clcmd("say_team /thetime","The_time",0,"Arata ora") register_clcmd("say /timeleft","Timeleft",0,"Arata timpul ramas") register_clcmd("say_team /timeleft","Timeleft",0,"Arata timpul ramas") } public The_time() { if(task_exists(1)) remove_task(1) else set_task(1.0,"the_time",1,_,_,"b",_) } public Timeleft() { if(task_exists(2)) remove_task(2) else set_task(1.0,"timeleft",2,_,_,"b",_) } public the_time() { static time[33] get_time("%H:%M:%S",time,32) set_hudmessage(255, 0, 0, 0.95, 0.01, 0, 0.1, 0.9, 0.1, 0.1, -1) show_hudmessage(0 , "Time: %s ",time) } public timeleft() { static timeleft timeleft = get_timeleft() set_hudmessage(255, 0, 0, 0.95, 0.03, 0, 0.1, 0.9, 0.1, 0.1, -1) show_hudmessage(0 , "Timeleft: %d:%02d ",timeleft / 60, timeleft % 60) } Should I add them as parameters then use them in the show_hudmessage(id,message) instead of the 0 ? |
Re: How to show hud to individual players
Post in Suggestion/Request section if you're a beginner. Scripting help section is intended for people who at least have basic knowledge in scripting.
I don't know why you're setting a task, but here you go. PHP Code:
|
Re: How to show hud to individual players
Quote:
Lol I'm not a beginner it wasn't about this plugin specifically this was a example I'm using it for something else thx though :) |
Re: How to show hud to individual players
Quote:
|
Re: How to show hud to individual players
Quote:
|
| All times are GMT -4. The time now is 17:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.