By
DoraTehExploda Code:
/*
Okay, now that you have successfully completed(or I am assuming you did since you are looking at this) a very simple
walllhack,wireframe, and wiremodels, lets get into this a bit deeper...
*/
/*
I am now assuming that you probably would love to get some hotkeys setup to enable/disable the all the bools you have
done up to this point... I will now show you how this would be done...
*/
/*
Make everything I have shown you up to this point just:
bool wallhack;
bool wireframe;
bool wiremodel;
Instead of the original:
bool wallhack = true;
bool wireframe = true;
bool wiremodel = true;
Now, since thats done, go ahead and do this also.. Its used for key toggling...
bool num1pressed = false;
bool num2pressed = false;
bool num3pressed = false;
Now, for the actual coding of the key toggles.. This also goes into glBegin.. Above or below your wallhack, wireframe,
and wiremodel code...
*/
if(GetAsyncKeyState(VK_NUMPAD1) <0 && ! num1pressed)
{
wallhack = !wallhack;
num1pressed = true;
}
else if(!(GetAsyneKeyState(VK_NUMPAD1) <0))
{
num1pressed = false;
}
if(GetAsyncKeyState(VK_NUMPAD2) <0 && ! num2pressed)
{
wireframe = !wireframe;
num2pressed = true;
}
else if(!(GetAsyneKeyState(VK_NUMPAD2) <0))
{
num2pressed = false;
}
if(GetAsyncKeyState(VK_NUMPAD3) <0 && ! num3pressed)
{
wiremodel = !wiremodel;
num3pressed = true;
}
else if(!(GetAsyneKeyState(VK_NUMPAD3) <0))
{
num3pressed = false;
}
/*
Now, this is all complete.. The next tutorial will feature more hack based stuff to go off of.. Again, if there is any
question's just feel free to ask, I am a helpdesk and will help to the best of my knowledge... Enjoy everyone...
DoraTehExploda
*/
Credits -> Kalvin for overlooking my key toggling code and helping me fix the not wanting to toggle off.. Mad <3...
Garrett