Blockland Forums > Modification Help
I need help with a script.
(1/3) > >>
TheStranger:
Okay, there are two separate functions. In one function, I create a variable with two arrays - The player, and another player. But in the other function, I want to recall the second array (The other player) using a server command, but I can't figure out how to. Can anybody help with this? Thanks!
otto-san:

--- Code: ---$pCt = -1;

function serverCmdsetupStuff(%client, %first, %second)
{
  $player[$pCt++] = findClientByName(%first).player;
  $player[$pCt++] = findClientByName(%second).player;
}

function serverCmdrecallStuff(%client, %num)
{
  messageClient(%client,'',"\c6"@$player[%num].client.name SPC $player[%num]);
}
--- End code ---

something like that?
TheStranger:
Actually, I kind of worded it terribly. Here's what my code looks like:

--- Code: ---function serverCmdtest(%client, %text)
{
%name = %client.getPlayerName();
$var[%name,%text] = true;
}
--- End code ---

As you can see in line 3, I placed both the name and the text in the same array. Can I still call both of them in a separate function, or should I remove one string because I messed up?
otto-san:
I think $var[*,text] should work, but I never had to do that so I'm not sure.
Red_Guy:
the "$" in front of variable names means its a global

globals can be used anywhere
Navigation
Message Index
Next page

Go to full version