ADD: I ran into this problem again, and I think that I should tell everyone what the REALLY IMPORTANT part is that WILL make it function properly.
Example 1 (non working):
PHP Code:
player.attr[21] = @{ "foo", "bar" };
player.attr[22] = "yourganiname.gani";
PHP Code:
SCRIPT
function onPlayerEnters() setTimer(.05);
function onTimeOut()
{
player.chat = "[" @ player.attr[21][0] @ "]";
setTimer(.05);
}
SCRIPTEND
This will set your chat to: [foo]
However, if you try to change player.attr[21] to something else (atleast serversided, didnt try to do it on clientside) - your chat will not update. I guess this is because
attr is not supposed to be used as an array, but, it WILL work if you tokenize the attr array.
Example 2 (working):
PHP Code:
player.attr[21] = @{ "foo2", "bar2" };
PHP Code:
SCRIPT
function onPlayerEnters() setTimer(.05);
function onTimeOut()
{
player.chat = "[" @ player.attr[21].tokenize()[0] @ "]";
setTimer(.05);
}
SCRIPTEND
I hope this will be of more help.
