random hud text
im trying to get this to work but it gives me errors in game someone to help me?
PHP Code:
|
Re: random hud text
What errors do you receive?
If I remember correctly random_num(a, b) returns a random number from a to b, including b in the range. So you will sometimes set randoms = MAX which will result in an index out of bounds error. Try using random_num(0, MAX - 1); |
Re: random hud text
hahah
sending hud info to players every 20 frames is basically DOSing them |
Re: random hud text
Quote:
smart kids... |
Re: random hud text
What he's trying to say is that it is a bad idea to send hudmessages on Client_PostThink. You can (and probably should) specify them to stay up for 1 second or more and utilize set_task to send them at more reasonable intervals.
Quote:
|
Re: random hud text
Quote:
|
Re: random hud text
That is my suggestion. The "holdtime" parameter of set_hudmessage allows you to keep the hudmessage on screen for 1 second (or longer). You then use set_task to run a task every second and send the hudmessage to all connected players.
|
Re: random hud text
Quote:
if(get_gametime() - 1.0 > delay_hud[id]) delay_hud[id] = get_gametime() |
Re: random hud text
That would work too, if you absolutely positively want to use Client_PreThink for this. I wouldn't consider this the right tool for the job though. Unless you have a very good reason to do it this way I would still recommend using a task and letting AMXX do the job for you.
If you are still certain you want to use PreThink, do it like this: PHP Code:
|
Re: random hud text
If we are talking about permanent HUD message, my best suggestions are with self repeating task, or with thinking entity (like it's better I think).
|
| All times are GMT -4. The time now is 09:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.