AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Help with convars (https://forums.alliedmods.net/showthread.php?t=283367)

BraveFox 06-01-2016 07:44

Help with convars
 
Hey,
Is there any way to do that convar will be at diffrent value on only 1 player I mean if I have the convar(example only)plugin_useplugincommands so I can do it 1 for player that I am choosing and 0 to the other.
is that possible?
thx.

TheUnderTaker 06-01-2016 08:17

Re: Help with convars
 
It would be easier to make a command that effect on only 1 player,
you can try convar and make a loop to check the players in the servers.

Chaosxk 06-01-2016 08:33

Re: Help with convars
 
This was asked and answered 2 days ago.

https://forums.alliedmods.net/showpo...60&postcount=2

BraveFox 06-01-2016 08:33

Re: Help with convars
 
Quote:

Originally Posted by TheUnderTaker (Post 2423763)
It would be easier to make a command that effect on only 1 player,
you can try convar and make a loop to check the players in the servers.

I want that when there are(example) 3 players from red team alive my convar will be "1" for 1 player only that I choose

BraveFox 06-01-2016 09:22

Re: Help with convars
 
Quote:

Originally Posted by Chaosxk (Post 2423767)
This was asked and answered 2 days ago.

https://forums.alliedmods.net/showpo...60&postcount=2

Bro,
I want a convar from my plugin

Chaosxk 06-01-2016 12:53

Re: Help with convars
 
Did you bother to even click the link? If you bothered then you would know to use ReplicateToClient() on your convar handle.

BraveFox 06-02-2016 16:45

Re: Help with convars
 
Quote:

Originally Posted by Chaosxk (Post 2423849)
Did you bother to even click the link? If you bothered then you would know to use ReplicateToClient() on your convar handle.

I tried to use it and it worked but that what I got in my console:
ConVarRef convar_use doesn't point to an existing ConVar
SetConVar: No such cvar ( convar_use set to 1), skipping

ddhoward 06-02-2016 17:18

Re: Help with convars
 
Quote:

Originally Posted by Chaosxk (Post 2423849)
Did you bother to even click the link? If you bothered then you would know to use ReplicateToClient() on your convar handle.

That is very incorrect. You cannot replicate convars to clients if those convars do not exist on the client.


BraveFox, you're thinking about this all wrong. You can't set a server-side, plugin-created convar to be different from one player to the other. There is only 1 instance of the convar, which is on the server.

You need to rewrite your code to ignore the setting of the convar for certain players.

BraveFox 06-03-2016 02:34

Re: Help with convars
 
Quote:

Originally Posted by ddhoward (Post 2424261)
That is very incorrect. You cannot replicate convars to clients if those convars do not exist on the client.


BraveFox, you're thinking about this all wrong. You can't set a server-side, plugin-created convar to be different from one player to the other. There is only 1 instance of the convar, which is on the server.

You need to rewrite your code to ignore the setting of the convar for certain players.

How?

ddhoward 06-03-2016 04:19

Re: Help with convars
 
IDK, it's your code. Something like

PHP Code:

if (client == someClientThatWeWantADifferentValueFor) {
    
//do something involving a different value
}
else {
    
//do something else involving the convar's value


Are you even sure that a convar is something that you should be using here?


All times are GMT -4. The time now is 18:06.

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