Talk:Adding an experience system: Difference between revisions
Line 11: | Line 11: | ||
Also, the way to add exp from killing isn't working. | Also, the way to add exp from killing isn't working. | ||
I can't help with your first problem, but if the add xp for kills problem you're having is that the two variables don't exist, add this just before the code he gives: | |||
CBaseEntity *pInflictor = info.GetInflictor(); | |||
CBaseEntity *pKiller = info.GetAttacker(); | |||
I have a problem where the game crashes at the line where the hud file searches for the Hud_Level: | |||
SetLabelText(vgui::localize()->Find("#Hud_Level")); | |||
Crashes from a memory read error every time. Anyone know why? | |||
[[User:PoopShipDestroyer|PoopShipDestroyer]] 11:24, 27 Feb 2008 (PST) |
Revision as of 12:24, 27 February 2008
There are some typos in this tutorial, overall very great and i could imagine how hard it was to make. if you follow the text right off you will get min 92 errors. plz if you got the time look over it again, an example is that it says "chl2mp_player.h" when it should be "C_hl2mp_player.h" and on one point you say put the code in hl2map_player.h when you mean C_hl2mp_player.h. its great otherwise, easy to fix for an average coder. —Unsigned comment added by Fabbecool (talk • contribs) Always sign your posts with four tildes (~~~~)
Lines not working
Lines ClientPrint( this, HUD_PRINTTALK, "You have reached level %i\n", m_iLevel ); // write it on their screenUTIL_ClientPrintAll( HUD_PRINTCONSOLE, "%s has reached level %i\n", GetPlayerName(), m_iLevel ); // write it in everyone's console
don't work.
I used even m_iLevel.M_iValue unsuccessfuly. The only working thing is (char*)m_iLevel.M_iValue. but i don't know what effects could have.
Also, the way to add exp from killing isn't working.
I can't help with your first problem, but if the add xp for kills problem you're having is that the two variables don't exist, add this just before the code he gives:
CBaseEntity *pInflictor = info.GetInflictor(); CBaseEntity *pKiller = info.GetAttacker();
I have a problem where the game crashes at the line where the hud file searches for the Hud_Level:
SetLabelText(vgui::localize()->Find("#Hud_Level"));
Crashes from a memory read error every time. Anyone know why?
PoopShipDestroyer 11:24, 27 Feb 2008 (PST)