Results 1 to 7 of 7

Thread: rename

  1. #1
    Private
    Join Date
    Aug 2013
    Posts
    95
    Thanks
    13
    Thanked 4 Times in 3 Posts

    rename

    hello

    i want to know how i can rename like that: because i get script runtime error

    _quickmessage.gsc:

    PHP Code:
    if(response == "testtag")
            {
                    
    self setclientcvar("name""test "name);
                    
    self iprintlnbold("Your name is changed!");
            } 
    quickoptions.menu:
    HTML Code:
    itemDef
    		{
    			name			"window"
    			group			ingamebox
    			visible			1
    			rect			16 20 0 0
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			forecolor		1 1 1 1
    			textfont		UI_FONT_NORMAL
    			textscale		.24
    			textaligny		8
    			text			"1. ^1rename in test tag"
    			decoration
    		}
    		execKey "r" { scriptMenuresponse "testtag"; close quickoptions }
    script runtime error:
    HTML Code:
    ******* script compile error *******
    uninitialised variable 'name': (file 'maps/mp/gametypes/_quickmessages.gsc', line 534)
        self setclientcvar("name", "test "+ name);
                                                              *
    ************************************
    someone can help me? pls
    cordially ORDI
    xfire: ordi37zk

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Instead of:

    PHP Code:
    self setclientcvar("name""test "name); 
    use:

    PHP Code:
    self setclientcvar("name""test " self.name); 
    That should do it
    timescale 0.01

  3. The Following User Says Thank You to kung foo man For This Useful Post:

    ORDI (22nd March 2014)

  4. #3
    Private
    Join Date
    Aug 2013
    Posts
    95
    Thanks
    13
    Thanked 4 Times in 3 Posts
    thx kung foo man, it work
    you are a good guy

  5. #4
    Private
    Join Date
    Aug 2013
    Posts
    95
    Thanks
    13
    Thanked 4 Times in 3 Posts
    its true that if i had put: + name
    it was to put: name = and the name

  6. #5
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    what do you mean?

  7. #6
    Private pollo's Avatar
    Join Date
    Jul 2012
    Location
    Spain
    Posts
    116
    Thanks
    93
    Thanked 69 Times in 35 Posts
    Quote Originally Posted by Ni3ls View Post
    what do you mean?
    He said that he could do:

    PHP Code:
    name self.name;

    self setclientcvar("name""test " name); 
    #Ordi'sPersonalTranslator

    xD

  8. The Following 2 Users Say Thank You to pollo For This Useful Post:

    ORDI (23rd March 2014),YuriJurek (23rd March 2014)

  9. #7
    Private
    Join Date
    Aug 2013
    Posts
    95
    Thanks
    13
    Thanked 4 Times in 3 Posts
    ye xD exactly that
    this topic helped a few persons for scripting
    thx me

Posting Permissions

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