CMD:temposair(playerid, params[])
{
if(PlayerDados[playerid][Preso] < 1) return SendClientMessage(playerid, CINZA, "[LL ADMIN] Vocк nгo estб preso para usar este comando");
format(String, sizeof(String), "Faltam %d Segundos para vocк ficar livre!", PlayerDados[playerid][Preso]);
SendClientMessage(playerid, VERDE_CLARO, String);
return 1;
}
new Text:TextTimerJail[MAX_PLAYERS];
new TimerPlayerJail[MAX_PLAYERS];
forward UpdateJail(playerid);
public OnGameModeInit()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
TextTimerJail[i] = TextDrawCreate(139.0 ,408.0,"Preso: --:--");
TextDrawColor(TextTimerJail[i], 0x00FF80AA);
}
return 1;
}
public UpdateJail(playerid)
{
TextDrawHideForPlayer(playerid, TextTimerJail[playerid]);
new string[155];
format(string, sizeof(string), "Preso: %d", PlayerDados[playerid][Preso]);
TextDrawSetString(TextTimerJail[playerid], string);
TextDrawShowForPlayer(playerid, TextTimerJail[playerid]);
return 1;
}
CMD:prender(playerid, params[])
{
TimerPlayerJail[variavel do id do preso] = SetTimerEx("UpdateJail", 1000, true, "i", variavel do id do preso);
return 1;
}
//Quando o player cumprir o tempo de preso e for libertado:
KillTimer(TimerPlayerJail[playerid]);
CMD ![]() { new Tempo, Motivo[70]; if(PlayerDados[playerid][Admin] < 3) return SendClientMessage(playerid, BRANCO, "Vocк precisa ser admin nivel 3 para usar este comando!"); if(PlayerDados[playerid][Trabalhando] == false) return SendClientMessage(playerid, CINZA, "Vocк precisa trabalhar para usar o comando. Use /servico."); if(sscanf(params, "uis", ID, Tempo, Motivo)) return SendClientMessage(playerid, CINZA, "[LL ADMIN] Use /prender [ID] [Tempo] [Motivo]"), SendClientMessage(playerid, CINZA, "Use o comando para prender um jogador na cadeia"); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, BRANCO, "[ERRO] ID invalido"); format(String, sizeof(String), "[LL ADMIN] O Admin {1B95E0}%s{00C2EC} Prendeu {1B95E0}%s{00C2EC} por %d Segundos pelo motivo: %s\r\n", Nome(playerid), Nome(ID), Tempo, Motivo); SendClientMessageToAll(AZUL_CLARO, String); EscreverLog("LLADMIN/Logs/Presos.log", String); SetPlayerPos(ID, 264.6288,77.5742,1001.0391); SetPlayerInterior(ID, 6); PlayerDados[ID][Preso] = Tempo; TimerPreso = SetTimerEx("TempoPreso", 1000, true, "i", ID); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~// TimerPlayerJail[ID] = SetTimerEx("UpdateJail", 1000, true, "i", ID); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~// return 1; } |
CMD ![]() { if(PlayerDados[playerid][Admin] < 3) return SendClientMessage(playerid, BRANCO, "Vocк precisa ser admin nivel 3 para usar este comando!"); if(PlayerDados[playerid][Trabalhando] == false) return SendClientMessage(playerid, CINZA, "Vocк precisa trabalhar para usar o comando. Use /servico."); if(sscanf(params, "u", ID)) return SendClientMessage(playerid, CINZA, "[LL ADMIN] Use /soltar [ID]"), SendClientMessage(playerid, CINZA, "Use o comando para soltar um jogador preso"); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, BRANCO, "[ERRO] ID invalido"); if(PlayerDados[ID][Preso] == 0) return SendClientMessage(playerid, CINZA, "O Jogador nгo estб preso"); PlayerDados[ID][Preso] = 1; format(String, sizeof(String), "[LL ADMIN] O Admin {1B95E0}%s{00C2EC} Tirou o jogador {1B95E0}%s{00C2EC} da Cadeia", Nome(playerid), Nome(ID)); SendClientMessageToAll(AZUL_CLARO, String); return 1; } |