[ TUTORIAL ] Foto do usuário no eventalert

Com exclusividade para vocês :3


Tutorial:
1- Vá até SWF --> c_images e crie uma .htaccess para XAMPP e/ou APPLE,  ou web.config para IIS e  dentro deste arquivo coloque:
XAMPP e/ou Apple
RewriteEngine On
RewriteRule ^notifications/fig/(.*).png(|/)$ notifications/user.php?fig=$1

IIS:

<rule name="rule 1u">
<match url="^notifications/fig/(.*).png(|/)$" />
<action type="Rewrite" url="/notifications/user.php?fig={R:1}" />
</rule>

2- Agora dentro dessa mesma pasta (notifications) crie um arquivo chamado user.php e dentro do mesmo adicione:

<?php

    if(!isset($_GET["fig"]) || empty($_GET["fig"])) {
        echo "No fig request";
        exit;
    }
$fig = $_GET['fig'];
$fig .= str_replace("_", ".", $fig);
$ch = curl_init("http://www.avatar-retro.com/habbo-imaging/avatarimage?figure=$fig&action=wlk&direction=2&head_direction=3&gesture=sml&size=l");
    curl_setopt_array($ch, array(
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HEADER         => false,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_ENCODING       => "",
        CURLOPT_USERAGENT      => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
        CURLOPT_AUTOREFERER    => true,
        CURLOPT_SSL_VERIFYPEER => false
    ));

    $content = curl_exec($ch);
    $type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);

    curl_close($ch);

    if(!isset($content) || empty($content) || strpos($content, 'Not Found') !== false) {
        echo "Not found!";
        exit;
    }
     
    header("Content-Type: {$type}");

    echo $content;
?>

3- Agora salve o arquivo e vá até o seu emulador no comando EventAlertCommand.cs e substitua por este:

using Plus.Communication.Packets.Outgoing.Rooms.Notifications;
using Plus.Communication.Packets.Outgoing.Rooms.Notifications;
using Plus.HabboHotel.GameClients;

namespace Plus.HabboHotel.Rooms.Chat.Commands.Events
{
    internal class EventAlertCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get
            {
                return "command_event_alert";
            }
        }
        public string Parameters
        {
            get
            {
                return "%message%";
            }
        }
        public string Description
        {
            get
            {
                return "Enviar um alerta de hotel para seu evento!";
            }
        }
        public void Execute(GameClient Session, Room Room, string[] Params)
        {
            if (Session != null)
            {
                if (Room != null)
                {
                    if (Params.Length == 1)
                    {
                        Session.SendWhisper("Por favor, digite uma mensagem para enviar.");
                        return;
                    }
                    else
                    {
                        string Message = CommandManager.MergeParams(Params, 1);

                        PlusEnvironment.GetGame().GetClientManager().SendMessage(new RoomNotificationComposer("Está acontecendo um evento!",
                             "Está acontecendo um novo jogo realizado pela equipe Staff! <br><br>Este, tem o intuito de proporcionar um entretenimento a mais para os usuários!<br><br>Evento:<b>" + Message +
                             "</b><br>Por: <b>" + Session.GetHabbo().Username +
                             "</b> <br><br>Caso deseje participar, clique no botão abaixo!",
                             "/fig/" + Session.GetHabbo().Look + "", "Ir ao Evento", "event:navigator/goto/" + Session.GetHabbo().CurrentRoomId));
                    }
                }
            }
        }
    }
}


Imagens do funcionamento:


Créditos:
~ Core
~ Avatar Retro
~ www.CriaHabbos.ga (fixar)


EmoticonEmoticon