Author Topic: Client Script Error and CONSOLE error detect doesn't help!  (Read 1445 times)

This will be a private mod:
Code: [Select]
warn("Loading FrogBT v0.0.1 (Unstable)");

package FrogBT
function clientcmdChatMessage(%client,%b,%c,%all,%PreTag,%name,%postTag,%msg)
{
if(striPos(%msg,"@about") >= 0)
commandtoserver('messagesent', "FrogBT v0.0.1 Patch 2: Made by Frogger3140");
}

if(striPos(%msg,"@cake") >= 0)
commandtoserver('messagesent', "You," SPC %name @ ", deserve" SPC getrandom(10, 99) SPC "cakes!");
}

if(striPos(%msg,"@help") >= 0)
commandtoserver('messagesent', "FrogBT Commands: @about: About FrogBT. @help: FrogBT Help. @cake: CAKE.");
commandtoserver('messagesent', "FrogBT Math: COMING SOON");
}

parent::clientcmdChatMessage(%client,%b,%c,%all,%PreTag,%name,%postTag,%msg);
}
};
activatepackage(FrogBT);

echo("FrogBT Load Success!");
CONSOLE log attached

you have 4 more } than {, console said you have a syntax error, and i agree with it
try
Code: [Select]
warn("Loading FrogBT v0.0.1 (Unstable)");

package FrogBT
{
function clientcmdChatMessage(%client,%b,%c,%all,%PreTag,%name,%postTag,%msg)
{
if(striPos(%msg,"@about") >= 0)
commandtoserver('messagesent', "FrogBT v0.0.1 Patch 2: Made by Frogger3140");

if(striPos(%msg,"@cake") >= 0)
commandtoserver('messagesent', "You," SPC %name @ ", deserve" SPC getrandom(10, 99) SPC "cakes!");

if(striPos(%msg,"@help") >= 0)
{
commandtoserver('messagesent', "FrogBT Commands: @about: About FrogBT. @help: FrogBT Help. @cake: CAKE.");
commandtoserver('messagesent', "FrogBT Math: COMING SOON");
}

parent::clientcmdChatMessage(%client,%b,%c,%all,%PreTag,%name,%postTag,%msg);
}
};
activatepackage(FrogBT);

echo("FrogBT Load Success!");
i'm not sure how packages work, but for the rest of it, it should work

Thanks, now the problem is that it's not detecting the commands!
Code: [Select]
warn("Loading FrogCM v0.0.2 (Unstable)");

package FrogCM
{
function clientcmdChatMessage(%client,%b,%c,%all,%PreTag,%name,%postTag,%msg)
{
if(strstr(%msg,"@about") == 1)
commandtoserver('messagesent', "FrogCM v0.0.2: Made by Frogger3140. Fixed by phlack and Frogger3140.");

if(strstr(%msg,"@cake") == 1)
commandtoserver('messagesent', "You," SPC %name @ ", deserve" SPC getrandom(10, 99) SPC "cakes!");

if(strstr(%msg,"@help") == 1)
{
commandtoserver('messagesent', "FrogCM Commands: @about: About FrogCM. @help: FrogCM Help. @cake: CAKE.");
commandtoserver('messagesent', "FrogCM Math: COMING SOON");
}

parent::clientcmdChatMessage(%client,%b,%c,%all,%PreTag,%name,%postTag,%msg);
}
};
activatepackage(FrogCM);

echo("FrogCM Load Success!");


package might need a (), like a function, although i'm not sure
try taking out the package, and just leaving the function there


if(%msg $= "@about")
Thanks! Putting you on the FrogCM patcher list.