HLFX.Ru Forum
Показать все 1 сообщений этой темы на одной странице

HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- Custom DrawHudString Problem// Thirdperson //Hud Money (https://hlfx.ru/forum/showthread.php?threadid=2517)


Отправлено S34Qu4K3 02-01-2011 в 16:13:

Custom DrawHudString Problem// Thirdperson //Hud Money

Hi, I´m S34Qu4K3 from Spain and i have to write this in english beacause I don´t know russian

1)First Problem

I´ve made this tutorial from Wavelenght: http://articles.thewavelength.net/315/
I don´t have any problems with the cl_dll compilation but when I am in game (I use Single PLayer Source Code from HL SDK v 2.3) all the says are black, only work if I put ^0SomeText.

I think that the problem is here, in the saytext.cpp:

C++ Source Code:
else
{
  gHUD.DrawHudString( LINE_START, y, 320, g_szLineBuffer[i] ,255, 255, 0, 0 );
}


If i put this, the say is Black but if I put the original code:
C++ Source Code:
DrawConsoleString( LINE_START, y, g_szLineBuffer[i] );


I have the default colours but ^0,^1,^2, etc don´t work

I hope that somebody can help me

Question
I´ve made a tutorial which teach me how to make a Dash key with stamina bar, but now, I want to put the camera in thirdperson when I´m pressing the dash key

I´ve made some trys but I´m not able to make it. I´ve tried to execute the command "thirdperson" in pm_shared.cpp but i have compilation errors,
Undefined Symbol Engfuncs.
I´ve I put in pm_shared.cpp #include "cl_utils.h", when i try to compile, the header has lots of unexpected errors.
COde where the thirdperson command must be:

C++ Source Code:
1
for (i=0 ; i<2 ; i++)       // Determine x and y parts of velocity
2
  if(bIsDashing && (! ( pmove->flags & FL_DUCKING)))
3
  {
4
    //Increase Speed
5
    wishvel[i] = pmove->forward[i]*(fmove*200)+ pmove->right[i]*smove;
6
 
7
  /*My attemps
8
  			gEngfuncs.pfnClientCmd( "thirdperson" );
9
  			CAM_ToThirdPerson();
10
   			gEngfuncs.pfnClientCmd("snapshot\n");
11
  			CLIENT_COMMAND ( pmove, "thirdperson\n"); */
12
}
13
else
14
  wishvel[i] = pmove->forward[i]*fmove + pmove->right[i]*smove;
15
 
16
//etc...


HUD Money

I´ve made this tut form Half-Life Programing Planet: http://hlpp.thewavelength.net/tuts/money.htm

But now, i want to put a hud which shows the ammount of money.

In health.h i´ve put my money ammount variable:
C++ Source Code:
extern int m_iMoneyAmount;


Now, in health.cpp, in the function:
C++ Source Code:
CHudHealth::Draw(float flTime)


I´ve put:
C++ Source Code:
x = gHUD.DrawHudNumber(x + 300.0, y, DHN_3DIGITS | DHN_DRAWZERO, m_iMoneyAmount, r, g, b);


I can compile perfectly but in game, the number are allways 0, but my real ammount of money is not 0



I hope thath somebody could help me, sorry for my english :s, Bye


Временная зона GMT. Текущее время 19:09.
Показать все 1 сообщений этой темы на одной странице

На основе vBulletin версии 2.3.0
Авторское право © Jelsoft Enterprises Limited 2000 - 2002.
Дизайн и программирование: Crystice Softworks © 2005 - 2024