AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check knife cl_righthand (https://forums.alliedmods.net/showthread.php?t=318730)

SID12 09-17-2019 11:30

Check knife cl_righthand
 
So I was wondering if there is a way to check if the client has cl_righthand "1/0" if so can someone please tell me how can I check this :)

LearninG 09-17-2019 12:05

Re: Check knife cl_righthand
 
yes , query_client_cvar

SID12 09-17-2019 12:08

Re: Check knife cl_righthand
 
And how would i use it properly like if(query_client_cvar) something can you explain or is there anywhere I can find this?

LearninG 09-17-2019 12:27

Re: Check knife cl_righthand
 
Code:
#include <amxmodx> public plugin_init() {     register_plugin("query client cvar example" , "1.0" , "LearninG")     register_clcmd("say /test" , "test") } public test(id) {     query_client_cvar(id , "cl_righthand" , "Handler") } public Handler(id , const szCvar[] , const szValue[]) {     new value = str_to_num(szValue)     client_print(id , print_chat , "[AMXX] cl_righthand is %d" , value) }
if you want to check the value :
Code:
if(value == 1) {     //do your code } else {     //do your code }

SID12 09-17-2019 12:43

Re: Check knife cl_righthand
 
Oh that was it thx a lot


All times are GMT -4. The time now is 17:24.

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