That is because you are storing tyme as a local variable rather than a global one and you are not parsing it to the other function. Try this code instead....
code:
function OnGetScriptCommands(){
var ScriptCommands = "<ScriptCommands>";
ScriptCommands += "<Command>";
ScriptCommands += "<Name>sleep</Name>";
ScriptCommands += "<Description>Tempo para a contagem</Description>";
ScriptCommands += "<Parameters><Tempo em minutos></Parameters>";
ScriptCommands += "</Command>";
ScriptCommands += "</ScriptCommands>";
return ScriptCommands;
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
if (Message.substr(0, 7) == "/sleep "){
var tyme = Message.substr(Message.search(' ')*60000);
sleeptime(tyme);
return "";
}
}
function sleeptime(tyme)
{
MsgPlus.AddTimer("Statuz", tyme);
MsgPlus.DisplayToast("Status Changer", "Timer iniciado: "+tyme+" milisegundos para Offline");
}
function OnEvent_Timer(timerID)
{
if(timerID == "Statuz")
{
Messenger.MyStatus = 2;
}
}