Acompanhe abaixo as nossas exports juntamente com exemplos de funcionamento e as instruções precisas para realizar a exportação de forma correta.
Enviando solicitação
addCommandHandler('enviar', function( player, _, id )
if tonumber( id ) then
local assets = exports['[HS]Assets']
local alvo = assets:getPlayerID( id )
if alvo then
local infos = {
title = 'Solicitação', mess = 'O jogador '..getPlayerName( player )..' ( '..getElementData( player, 'ID')..' ) te enviou uma solicitação.';
teclas = { accept = 'E', denied = 'R' };
timer = 10, format = 1000;
resource = getResourceName( getThisResource( ) );
values = { elemento = player, mensagem = 'olá tudo bem?' }
}
assets:confirmation( alvo, infos )
end
end
end)
Recebendo solicitação
createEvent(getResourceName(getThisResource( ))..'HS:confirmation:status', root, function( alvo, infos, status )
if isElement( alvo ) and getElementType( alvo ) == 'player' and infos and type( infos ) == 'table' and status then
local assets = exports['[HS]Assets']
if status ~= 'denied' then
assets:outputMessage( infos.elemento, 'Confirmação aceita com sucesso.', 'success')
else
assets:outputMessage( infos.elemento, 'Confirmação recusada.', 'warning')
end
end
end)