> For the complete documentation index, see [llms.txt](https://wiki.hyperscripts.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.hyperscripts.com.br/documentacao/wiki/punir/punir.md).

# Punir

Acompanhe abaixo as nossas exports juntamente com exemplos de funcionamento e as instruções precisas para realizar a exportação de forma correta.

{% hint style="info" %}
Exports:

<pre class="language-lua"><code class="lang-lua">exports['[HS]Painel_Punir']:setBanimentoId( player, 'id', 'Motivo', 'Minuto', 1 )
<strong>exports['[HS]Painel_Punir']:setPrenderId( player, 'id', 'Motivo', 'Minuto', 1 )
</strong>exports['[HS]Painel_Punir']:romoveBanSerial( serial )
exports['[HS]Painel_Punir']:send_mensagem( player, alvo, msg )
exports['[HS]Painel_Punir']:getBanimentos(  )
</code></pre>

{% endhint %}

{% hint style="success" %}
setBan

```lua
addCommandHandler('setarban', function( player, _, id, tipo_timer, tempo, ... )
     local assets = exports['[HS]Assets']
     if id and tonumber( id ) >= 0 then
          if tipo_timer and tipo_timer ~= '' then
               if tempo and tonumber( tempo ) >= 1 then
                    local motivo = table.concat( { ... }, ' ' )
                    if motivo ~= '' then
                         local punir = exports['[HS]Painel_Punir']
                         if punir:setBanimentoId( player, id, motivo, tipo_timer, tonumber( tempo ) ) then
                              assets:outputMessage( player, 'O player foi banido com sucesso.', 'success')
                         end
                    else
                         assets:outputMessage( player, 'Digite um texo.', 'info' ) 
                    end
               else
                    assets:outputMessage( player, 'Digite um tempo maior que 0.', 'info' ) 
               end
          else
               assets:outputMessage( player, 'Digite o formato do timer.', 'info' ) 
          end
     else
          assets:outputMessage( player, 'Digite um id valido.', 'info' ) 
     end
end)
```

{% endhint %}

{% hint style="success" %}
setPrender

```lua
addCommandHandler('setarprender', function( player, _, id, tipo_timer, tempo, ... )
     local assets = exports['[HS]Assets']
     if id and tonumber( id ) >= 0 then
          if tipo_timer and tipo_timer ~= '' then
               if tempo and tonumber( tempo ) >= 1 then
                    local motivo = table.concat( { ... }, ' ' )
                    if motivo ~= '' then
                         local punir = exports['[HS]Painel_Punir']
                         if punir:setPrenderId( player, id, motivo, tipo_timer, tonumber( tempo ) ) then
                              assets:outputMessage( player, 'O player foi preso com sucesso.', 'success')
                         end
                    else
                         assets:outputMessage( player, 'Digite um texo.', 'info' ) 
                    end
               else
                    assets:outputMessage( player, 'Digite um tempo maior que 0.', 'info' ) 
               end
          else
               assets:outputMessage( player, 'Digite o formato do timer.', 'info' ) 
          end
     else
          assets:outputMessage( player, 'Digite um id valido.', 'info' ) 
     end
end)
```

{% endhint %}

{% hint style="danger" %}
removeBan

```lua
addCommandHandler( 'removeban', function( player, _, serial )
     if serial and serial ~= '' then
          local assets = exports['[HS]Assets']
          local punir = exports['[HS]Painel_Punir']
          local banido = punir:romoveBanSerial( serial )
          if banido == '' then
               assets:outputMessage( player, 'Esse serial não contem banimento.', 'success' )
          elseif banido == 'banido' then
               assets:outputMessage( player, 'Você removeu o ban do serial.', 'success' )
          elseif banido == 'preso' then
               assets:outputMessage( player, 'Você removeu o preso.', 'success' )
          end
     end
end)
```

{% endhint %}

{% hint style="info" %}
sendMessage

```lua
addCommandHandler( 'sendmensage', function( player, _, id, ... )
     if id and motivo ~= '' then
          local motivo = table.concat( { ... }, ' ' )
          local alvo = assets:getPlayerID( id )
          if alvo then
               local punir = exports['[HS]Painel_Punir']
               punir:send_mensagem( player, alvo, motivo )
          end
     end
end)
```

{% endhint %}

{% hint style="warning" %}
getBanimentos

```lua
addCommandHandler( 'getbanimentos', function( player )
     local punir = exports['[HS]Painel_Punir']
     local banimentos = punir:getBanimentos(  )
     iprint( banimentos )
end)
```

{% endhint %}
