Raised This Month: $ Target: $400
 0% 

Solved How i can cheack if "hud_centerid 1" for the clients?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 06-04-2019 , 16:13   How i can cheack if "hud_centerid 1" for the clients?
Reply With Quote #1

Hello, How can I verify that my client is setting up (hud_centerid 1) the activation setting?
In my poor code I tried three ways for it but it did not work:
PHP Code:
public client_PreThink(id) {
    
    
//test 1
    
new centerid1[32]
    
get_user_info(id"hud_centerid"centerid131)
        
    if ( 
centerid1[id] != ) {
        
client_print(idprint_chat"hud_centerid1 %d "centerid1)
    }
      
      
    
//test 2
    
new centerid2[16]
    
get_user_info(id"hud_centerid"centerid215)
        
    new 
hudcentrid2 str_to_num(centerid2)
        
    if (
hudcentrid2 != )
    {
        
client_print(idprint_chat"hud_centerid2 %d "hudcentrid2)
    }
    
    
    
//test 3
    
new centerid3[2]
    
    
get_user_info(id"hud_centerid"centerid31)
    
    if (
centerid3[0] == '1')
    {
        
client_print(idprint_chat"hud_centerid3 %d "centerid3)
    }
    return 
FMRES_IGNORED

__________________

Last edited by abdobiskra; 06-05-2019 at 07:31. Reason: Solved
abdobiskra is offline
Send a message via Skype™ to abdobiskra
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-04-2019 , 16:33   Re: How i can cheack if "hud_centerid 1" for the clients?
Reply With Quote #2

query_client_cvar

get_user_info works only for values set with the setinfo command.
__________________

Last edited by <VeCo>; 06-04-2019 at 16:34.
<VeCo> is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 06-05-2019 , 07:31   Re: How i can cheack if "hud_centerid 1" for the clients?
Reply With Quote #3

Quote:
Originally Posted by <VeCo> View Post
query_client_cvar

get_user_info works only for values set with the setinfo command.
Thank you.

Quote:
Originally Posted by JocAnis
And please think more when to use events which are called 10 or more times in a seconds...per player.. :/
These settings may help:
PHP Code:
    set_hudmessage(255255255, -1.00.6011.00.40.010.01, -1)
    
show_hudmessage(id,"%s %s",name,hp
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
JocAnis
Veteran Member
Join Date: Jun 2010
Old 06-05-2019 , 07:58   Re: How i can cheack if "hud_centerid 1" for the clients?
Reply With Quote #4

Quote:
Originally Posted by abdobiskra View Post
These settings may help:
PHP Code:
    set_hudmessage(255255255, -1.00.6011.00.40.010.01, -1)
    
show_hudmessage(id,"%s %s",name,hp
i dont know what you meant by that, but i wanted to tell you dont use client_prethink for checking player cvar, there are less server-painful option for that
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 06-04-2019 , 17:30   Re: How i can cheack if "hud_centerid 1" for the clients?
Reply With Quote #5

And please think more when to use events which are called 10 or more times in a seconds...per player.. :/
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 06-05-2019 , 08:27   Re: How i can cheack if "hud_centerid 1" for the clients?
Reply With Quote #6

@JocAnis
I thought you were talking about the duration of the message!
Yes, Just I did it to check.
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Reply



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:24.


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