Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin
Archive › Old Forum Threads › Help › Scripting Help › checkup for vac(valveanticheat) has loaded/is active
8 posts, 3 people · 791 views Thread Rating: ★★★★★
closedcheckup for vac(valveanticheat) has loaded/is active
Started by ghzero on 10-12-2007, 02:34 AM
ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
10-12-2007, 02:34 AM #1

hello,rnrncan anybody tell me an solve for check (safely) if VAC ist loaded(active) on the current server on that an plugin is runnin' ?!

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
10-12-2007, 12:09 PM #2

the server variable "secure" tell you if VAC is running or notrn(1 = VAC ; 0 = not VAC secured)rnrni never tried to retrieve the value of that variable so i'm not surernif it's possible at all.rnrnif i get some time i'll try it, if not i'm curious if you tried and had success.

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
10-12-2007, 07:10 PM #3

pretty sure 'secure' doesnt actually exist as a cvar.. try it in hlsw rcon.. it doesnt do anythingnnonly place i can think of that shows if its secure or not in the console is the status command.. maybe get all that data (or just part of it) and check if it contains secure or insecure (or whatever status command shows for an insecure server)nn*EDIT*nnok i just threw this together.. seems to work when i try it on a local server..ntyping amx_checkvac should print in your chat if vac is enabled or disabled.. so this might actually be a method you could use to get its statusnn

nn#include <amxmodx>nn#define VERSION "1.0"nnpublic plugin_init()n{n    register_plugin("Check VAC",VERSION,"diamond-optic")n    register_cvar("amx_checkvac_stats",VERSION,FCVAR_SERVER|FCVAR_SPONLY)n    n    register_concmd("amx_checkvac","amx_checkvac",0,"- Check if VAC is enabled") n}nnpublic amx_checkvac(id)n{n    new data[512]                               //register the variablen    get_cvar_string("status",data,511)          //get what the status cmd saysn    n    if(containi(data,"insecure"))               //check if its insecure firstn        client_print(id,print_chat,"VAC DISABLED!")n    else if(containi(data,"secure"))            //then check if its securen        client_print(id,print_chat,"VAC ENABLED!")n    else                                        //it didnt get eithern        client_print(id,print_chat,"VAC STATUS UNKNOWN")nn    return PLUGIN_HANDLED                       //end the commandn}
nn*edit* ^ that code doesnt work :(

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
10-12-2007, 08:29 PM #4

actually NEVERMIND!nnlol that is saying VAC is disabled even when it is a secure server..nnidk if its just me but i cant seem to get the contain (or containi) natives to work right.. nni just tried using it in a different plugin to check a line in an ini file and whether it contains what im looking for or not it always returns that it did.. what gives here lolnn*EDIT*nnok lol guess i was using contain wrong, as it returns -1 on failure and not 0.. but that still doesnt make it work, so im guessing that reading status as a cvar doesnt work lol, which i figured as much to begin with.. so ya nevermind again lol

ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
10-12-2007, 08:59 PM #5
actually NEVERMIND!rnrnlol that is saying VAC is disabled even when it is a secure server..rnrnidk if its just me but i cant seem to get the contain (or containi) natives to work right.. rnrni just tried using it in a different plugin to check a line in an ini file and whether it contains what im looking for or not it always returns that it did.. what gives here lolrnrn*EDIT*rnrnok lol guess i was using contain wrong, as it returns -1 on failure and not 0.. but that still doesnt make it work, so im guessing that reading status as a cvar doesnt work lol, which i figured as much to begin with.. so ya nevermind again lol
rnrnrn(first thank you all for helping!)rnrn...reason for desfunction can be:rnvac will be loaded after a break of seconds the mapchange/startup has done...not from plugin_init-time !! so it needs an set_task with maybe 5 seconds to check that. but the problem will be that you script can check that, but it is not safe enough ..this means...an player can name "SecuredKiller" an your script found the word secure... and an name of "InsecuredMonster" can kick that check to fail... rnrn..maybe the result of "status" must be cutted from:rn
statusrnhostname: - DOD Serverrnversion : 47/1.1.2.5/Stdio 3651 secure rntcp/ip : 84.16.2XX.1XX:28100rnmap : dod_flugplatz at: 0 x, 0 y, 0 zrnplayers : 5 active (18 max)rnrn# name userid uniqueid frag time ping loss adrrn# 1 "Smok3" 1380 UNKNOWN 14 30:05:38 0 0 rn# 2 "phobos" 1381 UNKNOWN 15 30:05:38 0 0 rn# 3 "Ronin Marmot" 1382 UNKNOWN 16 30:05:38 0 0 rn# 4 "-CARDIAC-" 1383 UNKNOWN 12 30:05:38 0 0 rn# 5 "vittu" 1384 UNKNOWN 9 30:05:38 0 0 rn5 usersrn
rnrnto a safe collection of it like:rn
rnversion : 47/1.1.2.5/Stdio 3651 secure rn
rnrnonly the version-line can help out to check this safely.. but I dont know how to cutting the string in sma-style in php4/5 we can search for the string between the X linefeed and the Y linefeed to cut the version line ...

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
10-12-2007, 09:20 PM #6

ya i cant think of a way of using a plugin to get the data printed by the status command..nnif theres a way to do it and get each individual like or check if the line starts with # then it would probably work.. but i did think bout the name thing.. but i figured it would see the real secure/insecure 1st and check that and once it does that once have it end..nn*edit*nngame-monitor.com is able to get if its secure or not when you look at a servers variable list

ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
10-12-2007, 10:56 PM #7
ya i cant think of a way of using a plugin to get the data printed by the status command..rnrnif theres a way to do it and get each individual like or check if the line starts with # then it would probably work.. but i did think bout the name thing.. but i figured it would see the real secure/insecure 1st and check that and once it does that once have it end..
rnrna question pls .. is it not possible to send serverconsole-command and get the result back ?! if not, the only way will be to query the own server from the server himself (lol) for the serverstatus what an fat workaround and large code will be to get that simple info. another nice solve for that problem can be an dynamic php -site created to query an serveraddress to give back the secure-status ..the plugin must only open that hhtp-link(incl.address:ip) to "read" his own secure-status.

ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
10-13-2007, 12:01 AM #8
game-monitor.com is able to get if its secure or not when you look at a servers variable list
rnrngame-monitor.com has a internal coded flodding/firewall for requests - so if an ip make many requests that website stops delivery. and game-monitor is sometimes very slow.. that slows down the pluginworking..rnrnI'm goin to use that way now:rn-coding phpsite(soap) for check the status of securern-amxmodx: using sockets for call the phpsite

Archive › Old Forum Threads › Help › Scripting Help › checkup for vac(valveanticheat) has loaded/is active
DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC