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;
}
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;
}