AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   cvar - by id (https://forums.alliedmods.net/showthread.php?t=46308)

spider853 10-23-2006 05:32

cvar - by id
 
How I Can Set Or Get A cvar On A Specific id.. (User) ?:(

MaximusBrood 10-23-2006 06:49

Re: cvar - by id
 
Quote:

Originally Posted by spider853 (Post 394259)
How I Can Set Or Get A cvar On A Specific id.. (User) ?:(

Explain more. I don't understand your post at all.

Jordan 10-23-2006 06:57

Re: cvar - by id
 
I think he wants to know if you can (for example) like, set friendly fire on to one person using cvars.

spider853 10-23-2006 06:59

Re: cvar - by id
 
I Want To Make A CVAR like private_enable 1 or 0
For Each Person

ex: get_cvar_num(id,"private_enable")

This Problem Can Appear In This Script:
To Make A Script That Collect All Sensitivity Values From All Clients

spider853 10-23-2006 07:13

Re: cvar - by id
 
I Search And Found Somthing Like This:
query_client_cvar(id, const cvar[], const resultFunc[], paramlen=0, const params[] = "");

...

Its That I Need??

or function register_cvar() is for globaly cvar??

spider853 10-24-2006 10:28

Re: cvar - by id
 
Solved....
I Made A function clcmd and an boolean array with all users .
When a User set The Cvar (function) I read The Parameter And Put it in to array

----Code------

PHP Code:

new bool:UsersED[33]={true,...} //Users That Enable/Disable Private Chat
...
register_clcmd("pm_enable","enabledisable")
...
public 
enabledisable(id) {
 new 
Arg1[1]
 
read_args(Arg1,1)
 if (
Arg1[0]) {
  switch (
str_to_num(Arg1[0])) 
  {
  case 
1: { 
   
UsersED[id] = true
   
}
   case 
0: {
   
UsersED[id] = false
   
}
   default: 
console_print(id,"[PrivateChat] Invalid Parameters, Use <1|0>")
  }
 }
 
console_print(id,"[PrivateChat] Private Chat is %s",(UsersED[id]==true)?"Enabled":"Disabled"
 return 
PLUGIN_HANDLED




All times are GMT -4. The time now is 04:58.

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