Thread: Gani Solutions!
View Single Post
  #5  
Old 07-20-2007, 07:07 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
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.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote