Results 1 to 13 of 13
  1. #1
    ChanceOfHax's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    PlayerInfo* pPlayer = SearchPlayerByIndex(ChanceOfHax);
    Posts
    113
    Reputation
    3
    Thanks
    5
    My Mood
    Sneaky

    DrawButton problem

    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:
    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);
    	}
    }
    and my call:
    Code:
    DrawButton(10, 10, 20, White, TransBlack, "lol", lol, pDevice);
    Why my vaiable dont change?!

  2. #2
    GodHack2's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    644
    Reputation
    38
    Thanks
    762
    My Mood
    Amused
    hack = !hack; lol?





    beat this bitches ^^^^^^^

    Current Stats : Bored :/


    Respect list :
    Crash !
    Gordon'
    Markoj

  3. #3
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,881
    Reputation
    163
    Thanks
    3,291
    My Mood
    Sleepy
    Cuz hack is it's own variable in the method.

    You can pass by reference if you want lol to actually change.

  4. #4
    kotentopf's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    602
    Reputation
    26
    Thanks
    251
    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?

  5. #5
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,881
    Reputation
    163
    Thanks
    3,291
    My Mood
    Sleepy
    Quote Originally Posted by kotentopf View Post
    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)
    hack = !hack will still work though.

  6. #6
    kotentopf's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    602
    Reputation
    26
    Thanks
    251
    Quote Originally Posted by Crash View Post
    hack = !hack will still work though.
    i know
    but i think we both know what can happens^^
    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?

  7. #7
    ChanceOfHax's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    PlayerInfo* pPlayer = SearchPlayerByIndex(ChanceOfHax);
    Posts
    113
    Reputation
    3
    Thanks
    5
    My Mood
    Sneaky
    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.

  8. #8
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    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

  9. #9
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Quote Originally Posted by topblast View Post
    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.
    Lol button function.. You can make one with like 18 lines or less..

  10. #10
    kotentopf's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    602
    Reputation
    26
    Thanks
    251
    Quote Originally Posted by whit View Post


    Lol button function.. You can make one with like 18 lines or less..
    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?

  11. #11
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Quote Originally Posted by kotentopf View Post
    my one is 16 lines long
    but i need just 11

    when i add the drawfunctions of fillrgb there is much more
    Topblast just makes it sound so hard

  12. #12
    kotentopf's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    602
    Reputation
    26
    Thanks
    251
    Quote Originally Posted by whit View Post


    Topblast just makes it sound so hard
    Code:
    if(CodeStuff > U_NEED)
    {
    	Brain->ConfuseLevel++;
    	Code->MistakesAndErrors++;
    	PC->RAM++;
    
    	return OH_SHIT(ComplettlyCode);
    }
    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?

  13. The Following User Says Thank You to kotentopf For This Useful Post:

    whit (02-06-2011)

  14. #13
    coogle007's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    267
    Reputation
    18
    Thanks
    297
    My Mood
    Aggressive
    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à'