AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Force developer 0 (https://forums.alliedmods.net/showthread.php?t=54363)

the1991 04-23-2007 19:07

Force developer 0
 
I am new to scripting and I was wondering if it is possible to force clients to use certain cvars. I am interested in not allowing 'developer 1' on my server, so I am looking for something that automatically puts everyone at developer 0. Is it possible to do this? Is it difficult? Thanks!

Jheshka 04-23-2007 22:50

Re: Force developer 0
 
Code:
public client_connect( id ) {     client_cmd ( "developer 0" ) }

the1991 04-24-2007 18:52

Re: Force developer 0
 
that command only blocks it when the client connects. any way to set it so the client cannot change it back after they have connected?

DarlD 04-24-2007 19:05

Re: Force developer 0
 
you could create a loop
Code:
public client_connect(id) {      client_cmd("developer 0")      set_task(0.5,"loop") } public loop(id) {      client_cmd("developer 0")      set_task(0.5,"loop2") } public loop2(id) {      client_cmd("developer 0")      set_task(0.5,"loop") }

Styles 04-24-2007 19:13

Re: Force developer 0
 
lol DarlD. rofl why not do, use the set_task "b" for infinite checking :D.

the1991 04-24-2007 19:18

Re: Force developer 0
 
i did this, and i think it works, but i cant test it yet because my steam is screwed up:


Code:

public client_connect(id)
{
    client_cmd (id,"developer 0")
}

public client_command(id)
{
    client_cmd (id,"developer 0")
}


is this a good way to do it?

teame06 04-24-2007 19:23

Re: Force developer 0
 
The best way to do this is to poll the player cvar for developer. By using query_client_cvar native every so often. Just kick or ban them after so many checks.

Because of the client can do "developer 1; alias developer" even before they enter the server. It will lock you out from changing there setting.

This is what I would do.

the1991 04-24-2007 21:26

Re: Force developer 0
 
Quote:

Originally Posted by styles (Post 469250)
lol DarlD. rofl why not do, use the set_task "b" for infinite checking :D.



this seems like a good option, but will it lag the server?

the1991 04-24-2007 21:28

Re: Force developer 0
 
Quote:

Originally Posted by teame06 (Post 469258)
The best way to do this is to poll the player cvar for developer. By using query_client_cvar native every so often. Just kick or ban them after so many checks.

Because of the client can do "developer 1; alias developer" even before they enter the server. It will lock you out from changing there setting.

This is what I would do.


hah, i'm not so skilled at scripting yet. query just returns the the value that they are using correct?

and client_command runs every time the client sends a command correct? so if the client sends the command developer 1, it should just change back to developer 0 when the function is run?

bwgrubbs1 04-24-2007 22:18

Re: Force developer 0
 
Why don't you just set it up so that it doesn't force client to change it...but it runs a infinite loop of checking, using set_task and if client changes from dev 0 to dev 1 then it auto kicks them, and if they connect to your server it would IMMEDIATELY check what the dev cvar is set to and if set to 1 then kick, and print in console To play on this server you must have developer set to 0. Just an idea...this sounds good too me too so if anyone knows a quick way of doing this I would appreciate it too.


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

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