Blockland Forums > Modification Help
Ending a script?
(1/2) > >>
BlockStar:
Ok so I have a script and I tested it but it doesn't work. Sense all the code is correct I think I might have ended it wrong.

There's 5 different lines of code that end with the {. Then I closed it like this:

--- Code: ---                                                     }
                                          }
                                }
                      }
            };
--- End code ---

Did I do it wrong?

EDIT: I know my spacing is perfect, TAB doesn't work here.
soba:
Post the whole code
BlockStar:

--- Quote from: soba on October 07, 2011, 07:01:24 PM ---Post the whole code

--- End quote ---

Here, Also don't ask about it, I was board.


--- Code: ---function serverCmdTalkas(%client, %player,  %var1, %var2, %var3, %var4, %var5, %var6, %var7, %var8, %var9, %var10, %var11, %var12, %var13, %var14, %var15, %var16, %var17, %var18, %var19, %var20)
{
for(%a = 1; %a < 21; %a++)
{
if(%var[%a] !$= "")
{
%words = %words SPC %var[%a];
{
if(%client.isSuperAdmin)
{
messageAll(","\c3" @ %player @ "\c6: @ %words @");
}
else
{
messageClient(%client, '', "\c6You must be a super admin to use this command.");
}
}
}
}
};
--- End code ---
Headcrab Zombie:
Functions don't end with ;

You also have random brackets after '%words = %words SPC %var[%a];' and having the messageAll/Client inside the for loop will spam the chat with 20 messages


--- Code: ---function serverCmdTalkas(%client, %player,  %var1, %var2, %var3, %var4, %var5, %var6, %var7, %var8, %var9, %var10, %var11, %var12, %var13, %var14, %var15, %var16, %var17, %var18, %var19, %var20)
{
for(%a = 1; %a < 21; %a++)
{
if(%var[%a] !$= "")
{
%words = %words SPC %var[%a];
}
}

if(%client.isSuperAdmin)
{
messageAll(","\c3" @ %player @ "\c6: @ %words @");
}
else
{
messageClient(%client, '', "\c6You must be a super admin to use this command.");
}
}
--- End code ---
BlockStar:

--- Quote from: Headcrab Zombie on October 08, 2011, 02:06:50 AM ---Functions don't end with ;

You also have random brackets after '%words = %words SPC %var[%a];' and having the messageAll/Client inside the for loop will spam the chat with 20 messages

-snip-

--- End quote ---
That will work then right?
Navigation
Message Index
Next page

Go to full version