• MONEY за подписку! Ничего делать не надо совсем, всего-то подписаться на тг одмена и нажать кнопку "Принять участие" в розыгрыше: https://t.me/govthing/7650

Исходник Big Shaq hitmarker

  • Автор темы Автор темы wh1teend
  • Дата начала Дата начала
nixware.cc
Участник
Участник
Статус
Оффлайн
Регистрация
26 Янв 2017
Сообщения
581
Реакции
225
hey guys just wanted to release my dank hitmarker. its based on mark's hirmarker from this thread Hitmarker/Hitsound
the hitmarker class is almost the same as in marks source
Код:
Expand Collapse Copy
[LIST=1]
[*]#include <Windows.h>
[*]#pragma comment(lib, "Winmm.lib")
[*]#include "ka.h"
[*]#include "pa.h"
[*]#include "Render.h"
[*]class hitHealth
[*]{
[*]public:
[*]int pixY;
[*]int zadane;
[*]};
[*]int random(int min, int max) //range : [min, max)
[*]{
[*]static bool first = true;
[*]if (first)
[*]{
[*]srand(time(NULL)); //seeding for the first time only!
[*]first = false;
[*]}
[*]return min + rand() % (max - min);
[*]}
[*]class hitmarker
[*]{
[*]class player_hurt_listener
[*]: public IGameEventListener2
[*]{
[*]public:
[*]void start()
[*]{
[*]if (!g_EventManager->AddListener(this, "player_hurt", false)) {
[*]}
[*]}
[*]void stop()
[*]{
[*]g_EventManager->RemoveListener(this);
[*]}
[*]void FireGameEvent(IGameEvent *event) override
[*]{
[*]hitmarker::singleton()->on_fire_event(event);
[*]}
[*]int GetEventDebugID(void) override
[*]{
[*]return 0x2A;
[*]}
[*]};
[*]public:
[*]static hitmarker* singleton()
[*]{
[*]static hitmarker* instance = new hitmarker;
[*]return instance;
[*]}
[*]void initialize()
[*]{
[*]_listener.start();
[*]}
[*]void on_fire_event(IGameEvent* event)
[*]{
[*]if (!strcmp(event->GetName(), "player_hurt")) {
[*]int attacker = event->GetInt("attacker");
[*]if (g_Engine->GetPlayerForUserID(attacker) == g_Engine->GetLocalPlayer()) {
[*]LPCSTR theSound;
[*]switch (random(0, 2)) {
[*]case 0:
[*]theSound = (LPCSTR)paSound;
[*]_soundName = 0;
[*]break;
[*]case 1:
[*]theSound = (LPCSTR)kaSound;
[*]_soundName = 1;
[*]break;
[*]}
[*]if (g_Options.Visuals.bigShaq)
[*]PlaySoundA(theSound, NULL, SND_MEMORY | SND_ASYNC);
[*]_flHurtTime = g_Globals->curtime;
[*]}
[*]}
[*]}
[*]void on_paint()
[*]{
[*]auto curtime = g_Globals->curtime;
[*]auto lineSize = 8;
[*]if (_flHurtTime + 0.25f >= curtime) {
[*]int screenSizeX, screenCenterX;
[*]int screenSizeY, screenCenterY;
[*]g_Engine->GetScreenSize(screenSizeX, screenSizeY);
[*]screenCenterX = screenSizeX / 2;
[*]screenCenterY = screenSizeY / 2;
[*]g_Surface->DrawSetColor(200, 200, 200, 255);
[*]char* text;
[*]switch (_soundName) {
[*]case 0:
[*]text = "Pa!";
[*]break;
[*]case 1:
[*]text = "Ka!";
[*]break;
[*]}
[*]g_Render->DrawString2(g_Render->font.bigShaq /*some font use any */, screenCenterX + 50, screenCenterY - 30, Color::White(), FONT_CENTER, text);
[*]}
[*]}
[*]private:
[*]player_hurt_listener _listener;
[*]const char* _soundFileName = "csgo\\sound\\hitsound.wav";
[*]float _flHurtTime;
[*]int _soundName;
[*]};
[/LIST]
it has some junk from the original one like soundfilename of the original hitsound clean it up if you want

ofc you do this in initialization or dll main

Код:
Expand Collapse Copy
hitmarker::singleton()->initialize();

Код:
Expand Collapse Copy
hitmarker::singleton()->on_paint();

now the header files with sound bytes, they are too large so i uploaded them to pastebin
pa.h
Пожалуйста, авторизуйтесь для просмотра ссылки.

ka.h
Пожалуйста, авторизуйтесь для просмотра ссылки.

i know that they have a lot of empty bytes coz im 2 lazy
if you did everything correctly it should look like this
pretty dank huh?
thanks to me and mark for the hitmarker
Взято с UC(Не реклама)
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
А как ты музыку в байты перевёл?Или это не байты?
 
Назад
Сверху Снизу