PDA

View Full Version : CoD2: How to get a clientcvar



Para
3rd October 2014, 19:58
Hello,

getting clientcvars seems to be a very common problem in the codscript community. There are many threads about this topic but I couldn't even find one with an answer or even example to this question. After some days of research I came up with a solution to this problem. If you have been able to exploit another client-server-relation by codscript, then please post an example here how to do it.



getClientCvar(cvar)
{
// backup the clientname
backup_name = self.name;
// necessary for direct renaming
setClientNameMode("auto_change");
// changing the clientcvar "name" will change self.name (contains the value of cvar, therefor accessable by codscript)
self execClientCmd("setfromdvar name " + cvar);
// clientcmd has to be finished before retrieving self.name (therefor small delay)
wait 1;
cvar = self.name;
// restore clientname
self setClientCvar("name", backup_name);

return cvar;
}

IzNoGoD
3rd October 2014, 21:07
Please dont use the client's name to push cvars to the server, it can easily be eavesdropped on.

Use more advanced methods, like get_userinfo() which might be in the next release of libcod

Para
3rd October 2014, 21:19
Please dont use the client's name to push cvars to the server, it can easily be eavesdropped on.

Use more advanced methods, like get_userinfo() which might be in the next release of libcod

Well, I'm only using it right now to let admins change serversettings by clientinput. It can be used to steal client's key too but that actually wasn't my intention.

IzNoGoD
3rd October 2014, 23:30
Well, I'm only using it right now to let admins change serversettings by clientinput. It can be used to steal client's key too but that actually wasn't my intention.

CD keys are easy. Try streaming a cvar from a client without the client knowing you're streaming (com_maxfps for my jumpserver :) ) no openmenu() every frame needed with this new beauty :)

Para
4th October 2014, 21:19
getClientCvar only works if called by console(/openscriptmenu a cvar). When I tried to call it by menu-event, it returned self.name but it didn't rename to the value of cvar (scriptMenuResponse "cvar"). It seems like execClientCmd doesn't work if the scriptmenuresponse is called by a menu file. Does anyone know how to make it run?

IzNoGoD
4th October 2014, 22:55
you cannot get a cvar that way. You can store stuff by setting a cvar to "openscriptmenu menu response" and then exec vstr cvarname in your menu