Results 1 to 7 of 7
  1. #1
    memelare's Avatar
    Join Date
    Jul 2017
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0

    why doesnt it draw?

    Code:
    void DrawSpread()
    	{
    		CBaseEntity* localplayer = (CBaseEntity*)Interfaces.EntityList->GetClientEntity(Interfaces.pEngine->GetLocalPlayer());
    		if (!localplayer)
    			return;
    
    		CBaseCombatWeapon* activeWeapon = (CBaseCombatWeapon*)Interfaces.EntityList->GetClientEntityFromHandle(localplayer->GetActiveBaseCombatWeapon());
    		if (!activeWeapon)
    			return;
    
    		int width, height;
    		Interfaces.Engine->GetScreenSize(width, height);
    
    		if (Settings.GetMenuSetting(Tab_Visuals,Visuals_Spread))
    		{
    			float cone = activeWeapon->GetInaccuracy();
    
    			if (cone > 0.0f) {
    				float radius = (cone * height) / 1.5f;
    				Interfaces.Surface->DrawFilledCircle(width / 2, height / 2, radius, 255, 0, 0, 50);
    			}
    		}
    	}
    read title

  2. #2
    certmemer's Avatar
    Join Date
    Feb 2016
    Gender
    female
    Location
    Southampton
    Posts
    2,511
    Reputation
    104
    Thanks
    25,994
    float radius = (cone * height) / 1.5f;
    Interfaces.Surface->DrawFilledCircle(width / 2, height / 2, radius, 255, 0, 0, 50);

    wtf
    how about d e b u g g i n g it, maybe your getinaccuracy returns 0
    my steam acc: click
    donate me a few cents: click

  3. The Following User Says Thank You to certmemer For This Useful Post:

    Azuki (07-11-2017)

  4. #3
    ActualCheats's Avatar
    Join Date
    Dec 2015
    Gender
    male
    Location
    Yorkshire > All
    Posts
    348
    Reputation
    15
    Thanks
    132
    My Mood
    Inspired
    That's a ghetto method of doing it anyway. Someone posted on another forum the maths behind the correct way.

    IDA
    Code:
    // inside C_WeaponCSBase::DrawCrosshair
     
    // this is GetFOV probably
    (*(void (**)(void))(*(_DWORD *)v113 + 0x500))();
     
    v11 = result * 0.017453292 * 0.5;
    v154 = v11;
    (*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1936))(v2);
    v131 = v11;
    (*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1940))(v2);
    v133 = v11;
    __libm_sse2_tanf((__m128d)LODWORD(v154));
     
    // float spread_distance = ( (weapon->GetInaccuracy() + weapon->GetCone()) * 320.f ) / std::tan( Math::deg_to_rad(local_player->GetFOV()) * 0.5f )
    v117 = (float)((float)(v133 + v131) * 320.0) / v154;
    v137 = (float)((float)(v133 + v131) * 320.0) / v154;
    Code:

    Code:
    float spread_distance = ((localplayer->get_weapon()->get_accuracy() + localplayer->get_weapon()->get_cone()) * 320.f) / std::tan(DEG2RAD(player_fov) * 0.5f);
    
    float radius = spread_distance * (y / 480.f);
    Last edited by ActualCheats; 07-11-2017 at 03:31 PM.
    "The only wrong questions are the ones you don't ask" - My Father.

  5. #4
    certmemer's Avatar
    Join Date
    Feb 2016
    Gender
    female
    Location
    Southampton
    Posts
    2,511
    Reputation
    104
    Thanks
    25,994
    Quote Originally Posted by ActualCheats View Post
    That's a ghetto method of doing it anyway. Someone posted on another forum the maths behind the correct way.
    Code:
    float spread_distance = ((localplayer->get_weapon()->get_accuracy() + localplayer->get_weapon()->get_cone()) * 320.f) / std::tan(DEG2RAD(player_fov) * 0.5f);
    
    float radius = spread_distance * (y / 480.f);
    y being screen height
    my steam acc: click
    donate me a few cents: click

  6. #5
    ActualCheats's Avatar
    Join Date
    Dec 2015
    Gender
    male
    Location
    Yorkshire > All
    Posts
    348
    Reputation
    15
    Thanks
    132
    My Mood
    Inspired
    Quote Originally Posted by certmemer View Post
    y being screen height
    Yeah, let's call that anti-pasta.
    Last edited by ActualCheats; 07-11-2017 at 03:45 PM.
    "The only wrong questions are the ones you don't ask" - My Father.

  7. #6
    certmemer's Avatar
    Join Date
    Feb 2016
    Gender
    female
    Location
    Southampton
    Posts
    2,511
    Reputation
    104
    Thanks
    25,994
    inb4 this
    Code:
    void DrawSpread()
    	{
    		if (Settings.GetMenuSetting(Tab_Visuals,Visuals_Spread))
    		{
    			float cone = activeWeapon->GetInaccuracy();
    
    			if (cone > 0.0f) {
    	(*(void (**)(void))(*(_DWORD *)v113 + 0x500))();
     
    v11 = result * 0.017453292 * 0.5;
    v154 = v11;
    (*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1936))(v2);
    v131 = v11;
    (*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1940))(v2);
    v133 = v11;
    __libm_sse2_tanf((__m128d)LODWORD(v154));
     
    // float spread_distance = ( (weapon->GetInaccuracy() + weapon->GetCone()) * 320.f ) / std::tan( Math::deg_to_rad(local_player->GetFOV()) * 0.5f )
    v117 = (float)((float)(v133 + v131) * 320.0) / v154;
    v137 = (float)((float)(v133 + v131) * 320.0) / v154;
    			}
    		}
    	}
    my steam acc: click
    donate me a few cents: click

  8. #7
    ActualCheats's Avatar
    Join Date
    Dec 2015
    Gender
    male
    Location
    Yorkshire > All
    Posts
    348
    Reputation
    15
    Thanks
    132
    My Mood
    Inspired
    Quote Originally Posted by certmemer View Post
    inb4 this
    Code:
    void DrawSpread()
    	{
    		if (Settings.GetMenuSetting(Tab_Visuals,Visuals_Spread))
    		{
    			float cone = activeWeapon->GetInaccuracy();
    
    			if (cone > 0.0f) {
    	(*(void (**)(void))(*(_DWORD *)v113 + 0x500))();
     
    v11 = result * 0.017453292 * 0.5;
    v154 = v11;
    (*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1936))(v2);
    v131 = v11;
    (*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1940))(v2);
    v133 = v11;
    __libm_sse2_tanf((__m128d)LODWORD(v154));
     
    // float spread_distance = ( (weapon->GetInaccuracy() + weapon->GetCone()) * 320.f ) / std::tan( Math::deg_to_rad(local_player->GetFOV()) * 0.5f )
    v117 = (float)((float)(v133 + v131) * 320.0) / v154;
    v137 = (float)((float)(v133 + v131) * 320.0) / v154;
    			}
    		}
    	}
    lmao I hope not, that would be some gormless shit.
    "The only wrong questions are the ones you don't ask" - My Father.

Similar Threads

  1. [Help] Why doesnt crossfire work for me!?
    By methane95 in forum CrossFire Hacks & Cheats
    Replies: 29
    Last Post: 02-13-2010, 07:58 AM
  2. [Help] Why doesnt my warrock wont start
    By methane95 in forum WarRock Discussions
    Replies: 12
    Last Post: 01-26-2010, 12:49 PM
  3. Why doesnt chams work?
    By moris in forum Combat Arms Hacks & Cheats
    Replies: 15
    Last Post: 08-28-2008, 02:41 PM
  4. why doesnt 2prong work?
    By chubkakes in forum WarRock - International Hacks
    Replies: 12
    Last Post: 02-24-2008, 04:38 PM
  5. why doesnt this work?
    By $GHOST$ in forum C++/C Programming
    Replies: 11
    Last Post: 04-06-2006, 09:34 PM