PDA

View Full Version : rename



ORDI
22nd March 2014, 10:03
hello

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

_quickmessage.gsc:


if(response == "testtag")
{
self setclientcvar("name", "test "+ name);
self iprintlnbold("Your name is changed!");
}

quickoptions.menu:

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:

******* 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

kung foo man
22nd March 2014, 10:10
Instead of:


self setclientcvar("name", "test "+ name);

use:


self setclientcvar("name", "test " + self.name);

That should do it :D

ORDI
22nd March 2014, 10:18
thx kung foo man, it work
you are a good guy :D

ORDI
22nd March 2014, 15:28
its true that if i had put: + name
it was to put: name = and the name

Ni3ls
22nd March 2014, 17:13
what do you mean?

pollo
22nd March 2014, 23:03
what do you mean?

He said that he could do:


name = self.name;

self setclientcvar("name", "test " + name);

#Ordi'sPersonalTranslator

xD

ORDI
23rd March 2014, 11:47
ye xD exactly that ;)
this topic helped a few persons for scripting
thx me ;)