At first I couldn't figure out what was wrong, because I assumed your case's were correct.
My assumption was wrong.
I fixed the code, along with replacing the ^'s with actuall indentation.
case "--AdamBot_Code5":
CommandToServer('messageSent', "Code 5 initiating...");
if($IAmAdmin)
{
schedule(1000,0,shutdown);
}
case "AFK":
if(!hasItemOnList(%name, $AFKBot::List))
{
commandToServer('messageSent', "AdamBot: " @ %name @ " is now AFK.");
$AFKBot::list = addItemToList($AFKbot::List, %name);
}
case "Back":
if(hasItemOnList(%name, $AFKBot::List))
{
$AFKBot::list = removeItemfromList($AFKbot::List, %name);
commandToServer('messageSent', "AdamBot: " @ %name @ " is back!");
}
case: "BRB": commandToServer('messageSent', "AdamBot: " @ %name @ " will Be Right Back.");Also, using $IAmAdmin is not a smart idea, as you can just change it anytime you want.
You should check through the player list and check if the player is admin like that.