*:/mail = >>> msg('The following commands are available') msg('- /mail: show this message') msg('- /mail read: real all messages') msg('- /mail read : read message ') msg('- /mail clear: clear all messages') <<< *:/mail send $player $ = >>> assign(@mail, get_value(concat('mail_', to_lower($player)))) assign(@msg, array(player(), $)); if(is_null(@mail),assign(@mail, array())) array_push(@mail, @msg); store_value(concat('mail_', $player), @mail); msg(concat(color(green), 'Mail successfully sent to ', $player, color(white))) if(_isonline($player),tmsg($player,concat(color(green), 'You have mail! Type /mail read to view.', color(white)))) <<< *:/mail read = >>> assign(@mail, get_value(concat('mail_', to_lower(player())))) assign(@i, 1); if(is_null(@mail), msg(concat(color(red), 'You have no mail', color(white))) , foreach(@mail,@msg, if(lt(length(@msg[1]),20), assign(@message, @msg[1]) , assign(@message, concat(substr(@msg[1], 0, 17), '...')) ) msg(concat(@i, ') [', color(red), @msg[0], color(white),'] ', @message)) inc(@i); ) ) <<< *:/mail read $msg = >>> assign(@mail, get_value(concat('mail_', to_lower(player())))) try( msg(concat('[', color(red), @mail[subtract($msg, 1)][0],color(white),'] ', @mail[subtract($msg, 1)][1])) ,@ex, msg(concat(color(red), 'That message does not exist', color(white))) ) <<< *:/mail clear = >>> store_value(concat('mail_', to_lower(player())), null) msg(concat(color(green), 'Mail successfully cleared', color(white))) <<<