nixware.cc
-
Автор темы
- #1
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
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
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(Не реклама)
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]
ofc you do this in initialization or dll main
Код:
hitmarker::singleton()->initialize();
Код:
hitmarker::singleton()->on_paint();
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
thanks to me and mark for the hitmarker
Взято с UC(Не реклама)