client_PreThink for one client only
How would I use client_PreThink for one client only(admin)?
I want to avoid set_task. Code:
public client_PreThink(id) { |
Re: client_PreThink for one client only
You can check for SteamID or flag rights.
|
Re: client_PreThink for one client only
I wonder if this would work... haven't tested so I'm not sure.
Code:
|
Re: client_PreThink for one client only
Why do you want to avoid set_task?
Also, what do you mean you only want to use client_PreThink for one client only? It fires for every client and passes in the id of the client it's currently firing for. |
Re: client_PreThink for one client only
You can't do that, stupok, but it would be good thinking to set whether or not a user's PreThink should be tracked in client_putinserver, so that you don't have to calculate it every time. For example:
Code:
|
Re: client_PreThink for one client only
Quote:
Code:
Pretty much the same as your checking if the player id is admin. Not sure if one is more efficient than the other but you get the idea. |
Re: client_PreThink for one client only
I would definitely go with XxAvalanchexX 's method, it doesn't execute the is_user_admin() function every frame, which is completely unnecessary, so it is definitely much faster.
|
Re: client_PreThink for one client only
KaoS, it really depends on exactly what he wants to check. If it's a steamid comparison, it should be done somewhere besides prethink. If it's only to check if user is an admin, then your way would be fine too.
|
Re: client_PreThink for one client only
Yes I agree avalanche.
Your method is of course just as good. Just showing every possibility for it. Though he did say admin in his initial post which is why I gave my input. :up: |
Re: client_PreThink for one client only
Code:
I win. |
| All times are GMT -4. The time now is 06:54. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.