Raised This Month: $ Target: $400
 0% 

How to show hud to individual players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SID12
Junior Member
Join Date: May 2019
Old 08-20-2019 , 13:18   Re: How to show hud to individual players
Reply With Quote #3

Quote:
Originally Posted by edon1337 View Post
Show the full code, most likely the player id is in the function parameters.
They aren't in the parameters:


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 ?

Last edited by SID12; 08-20-2019 at 13:22.
SID12 is offline
 



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 17:30.


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