Quote:
Originally Posted by cbkbud
I thought the problem was that it was rejecting any string named message, therefor, it wouldn't let you do x.message ... ?
|
Actually it only only happens when using findnpc, findplayer, findlevel, actually, any function like object, odd huh?
All these scripts will produce the line
PHP Code:
function onCreated() {
echo(findplayer("Chompy").message); // if the player exists or not doesn't matter
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/
PHP Code:
function onCreated() {
echo(findad("pepsi").message); // doesn't matter if the function exists
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/
PHP Code:
function onCreated() {
echo(findbirdandpatit().message); // you get the point..
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/
Now, the weird thing about it is..
this works:
PHP Code:
function onCreated() {
temp.a_b = new TStaticVar();
temp.a_b.c = "foo";
temp.b = "_b";
echo(makevar("a"@b).c);
}
/*
foo
*/
while this doesn't
PHP Code:
function onCreated() {
temp.a_b = new TStaticVar();
temp.a_b.message = "foo";
temp.b = "_b";
echo(makevar("a"@b).message);
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/