hack = !hack; lol?
Ok guys.
I made a func to draw a button and it have hover effe*** and click effects.
But hwen i try to change a hack variable from 0 to 1(hack =! hack)
than it dont work.
My code:
and my call:Code:void DrawButton(int x, int y, int h, D3DCOLOR BorderColor, D3DCOLOR FillColor, char* Caption, int hack, LPDIRECT3DDEVICE9 pDevice) { gets (Caption); if(isMouseinRegion(menux+x,menuy+y,menux+x+strlen(Caption)*6,menuy+y+h) && !GetAsyncKeyState(VK_LBUTTON)) { DrawBox(menux+x, menuy+y, strlen(Caption)*6, h, TransGrey, BorderColor, pDevice); DrawString(menux+x+3, menuy+y+h/6, White, Directx_Font, Caption); } else if(isMouseinRegion(menux+x,menuy+y,menux+x+strlen(Caption)*6,menuy+y+h) && GetAsyncKeyState(VK_LBUTTON)) { DrawBox(menux+x, menuy+y, strlen(Caption)*6, h, Yellow_a, BorderColor, pDevice); DrawString(menux+x+6, menuy+y+h/4, White, Directx_Font, Caption); hack = !hack; } else if(!isMouseinRegion(menux+x,menuy+y,menux+x+strlen(Caption)*6,menuy+y+h)) { DrawBox(menux+x, menuy+y, strlen(Caption)*6, h, FillColor, BorderColor, pDevice); DrawString(menux+x+3, menuy+y+h/6, White, Directx_Font, Caption); } }
Why my vaiable dont change?!Code:DrawButton(10, 10, 20, White, TransBlack, "lol", lol, pDevice);
Cuz hack is it's own variable in the method.
You can pass by reference if you want lol to actually change.
hack = !hack is for bool
and if u want to change an external value u must make it with the & operator
void DrawButton(int x, int y, int h, D3DCOLOR BorderColor, D3DCOLOR FillColor, char* Caption, int &hack, LPDIRECT3DDEVICE9 pDevice)
The Internet SHOULD Be Illegal
When you say
"Java is a great programming language because it works on all platforms"
it is just like
"anal sex is great because it works on all genders"
Are YOU a Troll?
The Internet SHOULD Be Illegal
When you say
"Java is a great programming language because it works on all platforms"
it is just like
"anal sex is great because it works on all genders"
Are YOU a Troll?
Thx kotentopf It works
PS: u can change ints like bools from 1 to 0
Kotentopf hast du skype??
Last edited by ChanceOfHax; 02-06-2011 at 10:37 AM.
1 Wont u need a pointer to really change hack.
2 why not just return hack instead of all of this..
3 that button will flicker like hell.
4 what is the point of the colors if u use something else... hmm i guess the real color only shows when u are not over it.
5 Hmm i might just release a function for button .... but i have other things to do srry bye.
I just like programming, that is all.
Current Stuff:
- GPU Programmer (Cuda)
- Client/Server (Cloud Server)
- Mobile App Development
my one is 16 lines long
but i need just 11
when i add the drawfunctions of fillrgb there is much more
Code:void cButton::Draw(LPDIRECT3DDEVICE9 pDevice) { if(this->w < 40) this->w = 40; if(this->h < 15) this->h = 15; if(Hack.Readys.MouseIsOver(this->x,this->y,this->w,this->h)){ D3D.Draw.Box(this->x,this->y,this->w,this->h,1,0xFF2B6DFF,0xFF000000,pDevice,false,false); if(GetAsyncKeyState(1)&1) this->Return = true; }else{ D3D.Draw.Box(this->x,this->y,this->w,this->h,1,0xFF2B6DBF,0xFF000000,pDevice,false,false); } D3D.Draw.String(this->x + 2,this->y,0xFF3DFFFF,D3D.Settings.pFont,Hack.Misc.Encrypt(this->Text)); }
The Internet SHOULD Be Illegal
When you say
"Java is a great programming language because it works on all platforms"
it is just like
"anal sex is great because it works on all genders"
Are YOU a Troll?
The Internet SHOULD Be Illegal
When you say
"Java is a great programming language because it works on all platforms"
it is just like
"anal sex is great because it works on all genders"
Are YOU a Troll?
whit (02-06-2011)
You can do the same with less line of code for example this is mine
Code:void DrawCheckBox( int x, int y, int w, int h, D3DCOLOR BoxColor, D3DCOLOR BorderColor,char* Text,bool &hack ,IDirect3DDevice9* pDevice ) { FillRGB( x, y, w, h, BoxColor, pDevice ); DrawBorder( x, y, w, h, 2, BorderColor, pDevice ); DrawString(x+20,y,White,Directx_Font,Text); if(isMouseinRegion(x,y,x+15,y+15)){ if(GetAsyncKeyState(VK_LBUTTON)&1){ FillRGB( x, y, w, h, White, pDevice ); hack =! hack; }} } Result DrawCheckBox(60,60,15,15,Black,Red, "NX Chams",nx,pDevice);
My last Hack D3d Chams/Esp/Opk/Telekill
A me me piace 'o blues e tutt'e journe aggio cantà'
pecchè so stato zitto e mo è 'o mumento 'e me sfucà'
sono volgare e so che nella vita suonerò
pe chi tene 'e complessi e nun 'e vò
A me me piace 'o zucchero ca scenne dinto 'o cafè
e cu 'na presa d'annice ma chi è meglio 'e me
tengo 'a cazzimma e faccio tutto quello che mi va
pecchè so blues e nun voglio cagnà'