⚙️Punir
Acompanhe abaixo as nossas exports juntamente com exemplos de funcionamento e as instruções precisas para realizar a exportação de forma correta.
setBan
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)setPrender
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)removeBan
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)getBanimentos
addCommandHandler( 'getbanimentos', function( player )
     local punir = exports['[HS]Painel_Punir']
     local banimentos = punir:getBanimentos(  )
     iprint( banimentos )
end)Last updated
