Results 1 to 6 of 6

Thread: CoD2: How to get a clientcvar

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private
    Join Date
    Apr 2014
    Posts
    11
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Lightbulb CoD2: How to get a clientcvar

    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.

    Code:
    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;
    }
    Last edited by Para; 3rd October 2014 at 21:02.

  2. The Following User Says Thank You to Para For This Useful Post:

    Ni3ls (5th October 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •