Author Topic: Major SyntaxError within function containing $variables  (Read 392 times)

Code: [Select]
function TGG_startup() {($TGGfact1 = "1");##(##$TGGfact2 = "10");  //## around error as usual.{($TGGfact1 = "1");##(##$TGGfact2
"1");##(##$TGGf

What the heck is wrong with that code section?
I'm trying to make a client-sided chat Guessing Game script, and it's epic failing because of that.
By all means, it should work...

(The parentheses were around those statements... It doesn't work even without those.)
« Last Edit: August 21, 2010, 08:39:02 PM by ThinkInvisible »

you dont need parentheses to declare a variable

Code: [Select]
function TGG_startup()
{
$TGGfact1 = "1";
$TGGfact2 = "10";
}

that is what it should look like

Another problem...

Calling a If statement that tests subStr for something in the ClientCmdChatMessage thing :

if (%msg = getSubStr(%msg,"0","14","Is the number "))
     {bla bla bla}

But for some reason, it never executes 'bla bla bla'

Another problem...

Calling a If statement that tests subStr for something in the ClientCmdChatMessage thing :

if (%msg = getSubStr(%msg,"0","14","Is the number "))
     {bla bla bla}

But for some reason, it never executes 'bla bla bla'

if(%msg $= getSubStr(%msg,0,14))
{
   dothings..
}

We use $= to compare two strings. Plus, you said =, so you are saying %msg IS getsubstr(blah); ,if it was not a string, you would need to check if it was EQUAL TO, which is ==.

%this == %that?

for string

%this $= %that?
« Last Edit: August 21, 2010, 09:32:11 PM by Syntax »