-
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
-
Instead of:
PHP Code:
self setclientcvar("name", "test "+ name);
use:
PHP Code:
self setclientcvar("name", "test " + self.name);
That should do it :D
-
thx kung foo man, it work
you are a good guy :D
-
its true that if i had put: + name
it was to put: name = and the name
-
-
Quote:
Originally Posted by
Ni3ls
what do you mean?
He said that he could do:
PHP Code:
name = self.name;
self setclientcvar("name", "test " + name);
#Ordi'sPersonalTranslator
xD
-
ye xD exactly that ;)
this topic helped a few persons for scripting
thx me ;)