Исходник Big Shaq hitmarker

nixware.cc
Участник
Статус
Оффлайн
Регистрация
26 Янв 2017
Сообщения
547
Реакции[?]
225
Поинты[?]
0
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
Код:
[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

Код:
hitmarker::singleton()->initialize();
Код:
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(Не реклама)
 
Забаненный
Статус
Оффлайн
Регистрация
25 Янв 2017
Сообщения
206
Реакции[?]
22
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
А как ты музыку в байты перевёл?Или это не байты?
 
Сверху Снизу