[UNTESTED] Advanced away system

Started by EK.IceFlake, Jul 24, 2015, 09:14 AM

Previous topic - Next topic

EK.IceFlake

Hi guys!
Today I am going to improve on XuXus script! Maybe not, this is actually from scratch.
This is not my first snippet, so expect much from it :D
Note that it is untested so it might be bugged - in case of bugs tell me
If you can't install it, please buy a newer brain.
function onPlayerChat(player, message)
{local eargs = message.split(' ');
    eargs[0] = eargs[0].tolower();
    if (eargs[0] == "brb") (eargs.len() > 1)
    ?
    {
        MessageAll(player.Name + " will be right back due to " + message.slice(eargs[0].len() + 1) + ".");
        player.World = player.UniqueWorld - 1000;
        player.Frozen = true;
        player.Immunity = 127;
    }
    :
    {
        MessageAll(player.Name + " will be right back!");
        player.World = player.UniqueWorld - 1000;
        player.Frozen = true;
        player.Immunity = 127;
    };
    else if (eargs[0] == "bbs") (eargs.len() > 1)
    ?
    {
        MessageAll(player.Name + " will be back soon due to " + message.slice(eargs[0].len() + 1) + ".");
        player.World = player.UniqueWorld - 1000;
        player.Frozen = true;
        player.Immunity = 127;
    }
    :
    {
        MessageAll(player.Name + " will be back soon!");
        player.World = player.UniqueWorld - 1000;
        player.Frozen = true;
        player.Immunity = 127;
    };
    else if (eargs[0] == "bbl") (eargs.len() > 1)
    ?
    {
        MessageAll(player.Name + " will be back later due to " + message.slice(eargs[0].len() + 1) + ".");
        player.World = player.UniqueWorld - 1000;
        player.Frozen = true;
        player.Immunity = 127;
    }
    :
    {
        MessageAll(player.Name + " will be back later!");
        player.World = player.UniqueWorld - 1000;
        player.Frozen = true;
        player.Immunity = 127;
    };
    else if (eargs[0] == "back")
    {
        if (player.World == player.UniqueWorld - 1000)
        {
            MessageAll(player.Name + " is back!");
            player.World = 1;
            player.Frozen = false;
            player.Immunity = 0;
        }
        else MessagePlayer("You weren't away. Trying to spam, huh?");
    }
    else return 1;
}

Thijn

Why on earth would you release something that isn't tested?
Don't really like the short if syntax like that either. For beginners this will be hard to understand.