Pausear timer?
#1

Hola, tengo este comando para sancionar, pero queria que cuando un jugador sancionado salga del juego el timer pare y cuando entre de nuevo le ponga los minutos que le faltan. Como haria eso?
Comando:
pawn Код:
CMD:san(playerid,params[])
{
    if(AccountInfo[playerid][AdminLvl] >= 2)
    {
        new targetid, time, string1[250];
        if(sscanf(params, "dds[128]", targetid, time, params[3])) return SendClientMessage(playerid, -1, "[ERROR]: /san [ID] [Minutos] [Razon]");
            else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Usuario no conectado");
                else
                {
                    SetPlayerInterior(targetid, 3);
                    SetPlayerVirtualWorld(targetid,21);
                    SetPlayerPos(targetid, 291.282989,310.031982,999.148437);
                    SetTimerEx("UnJail",time*1000*60,false,"i",targetid);
                    AccountInfo[targetid][InJail] = 1;
                    ResetPlayerWeapons(targetid);
                    format(string1, sizeof(string1), "%s %s a sancionado a %s por %i minutos [Razon: %s]",GetAdminName(playerid),pNombre(playerid),pNombre(targetid),time,params[3]);
                    SendClientMessageToAll(COLOR_ERROR, string1);
                }
    }
    else {
        SendClientMessage(playerid,COLOR_AZUL,"No tienes permiso a usar este comando.");
    }
    return 1;
}

public UnJail(targetid)
{
   SetPlayerVirtualWorld(targetid,0);
   SpawnPlayer(targetid);
   SetPlayerInterior(targetid,0);
   SendClientMessage(targetid, -1, "{00FF00}» Tu sancion ha terminado, porfavor sigue las /reglas para la proxima.");
   AccountInfo[targetid][InJail] = 0;
   return 1;
}
Reply


Messages In This Thread
Pausear timer? - by Onfroi - 18.06.2013, 19:03
Respuesta: Pausear timer? - by OTACON - 18.06.2013, 19:30
Re: Respuesta: Pausear timer? - by Onfroi - 18.06.2013, 19:51
Respuesta: Pausear timer? - by TiNcH010 - 18.06.2013, 20:08
Respuesta: Pausear timer? - by xSDx - 18.06.2013, 20:18
Re: Respuesta: Pausear timer? - by Onfroi - 18.06.2013, 20:24
Respuesta: Pausear timer? - by xSDx - 18.06.2013, 20:34
Respuesta: Pausear timer? - by JustBored - 18.06.2013, 20:35
Re: Respuesta: Pausear timer? - by Onfroi - 18.06.2013, 21:24
Respuesta: Pausear timer? - by xSDx - 18.06.2013, 21:58

Forum Jump:


Users browsing this thread: 1 Guest(s)