Raised This Month: $51 Target: $400
 12% 

[CSGO] Client crash when m_iAddonBits used


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hitmany
Senior Member
Join Date: Jul 2010
Old 12-14-2016 , 23:16   [CSGO] Client crash when m_iAddonBits used
Reply With Quote #1

Hello, sometimes CSGO client crashing for all players on the server when m_iAddonBits code executed.

I need to make play invisble with 20%, but also I need to make an invisible weapon on back.
Maybe there's another way to make a invisible weapon on back without crash?
I am using -condebug -debug run parameters for CSGO client, but there is nothing except the chat in logs at the time of the crash
PHP Code:
public setinvis(client)
{
   new 
knife GetPlayerWeaponSlot(clientCS_SLOT_KNIFE);
   if (
knife != -1)
  {
       
SetEntProp(GetEntPropEnt(knifeProp_Send"m_hWeaponWorldModel"), Prop_Send"m_nModelIndex"0);
   }
   
SDKHookEx(clientSDKHook_PostThinkPostOnPostThinkPost);
    
invisible[client] = 1;
}

public 
PostThinkPost(client)
{
    if(
invisible[client] == 1)
    {
        
SetEntProp(clientProp_Send"m_iAddonBits",0);
    }

So I can't use RENDERMODE_NONE bcs I need 20% inv level for player

Last edited by hitmany; 12-14-2016 at 23:29.
hitmany is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 12-14-2016 , 23:40   Re: [CSGO] Client crash when m_iAddonBits used
Reply With Quote #2

Not sure if this still works but how about:
PHP Code:
void InvisibleKnife(int clientint amountbool apply)
{
    
int knife GetPlayerWeaponSlot(clientCS_SLOT_KNIFE);
    if (
knife != -1)
    {
        if (
apply)
        {
            
SetEntityRenderMode(knifeRENDER_TRANSALPHA);
            
SetEntityRenderColor(knife255255255amount);
        }
        else
        {
            
SetEntityRenderMode(knifeRENDER_NONE);
            
SetEntityRenderColor(knife255255255255);
        }
    }


Last edited by cravenge; 12-14-2016 at 23:41.
cravenge is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 12-15-2016 , 01:12   Re: [CSGO] Client crash when m_iAddonBits used
Reply With Quote #3

Quote:
Originally Posted by hitmany View Post
Hello, sometimes CSGO client crashing for all players on the server when m_iAddonBits code executed.

I need to make play invisble with 20%, but also I need to make an invisible weapon on back.
Maybe there's another way to make a invisible weapon on back without crash?
I am using -condebug -debug run parameters for CSGO client, but there is nothing except the chat in logs at the time of the crash
PHP Code:
public setinvis(client)
{
   new 
knife GetPlayerWeaponSlot(clientCS_SLOT_KNIFE);
   if (
knife != -1)
  {
       
SetEntProp(GetEntPropEnt(knifeProp_Send"m_hWeaponWorldModel"), Prop_Send"m_nModelIndex"0);
   }
   
SDKHookEx(clientSDKHook_PostThinkPostOnPostThinkPost);
    
invisible[client] = 1;
}

public 
PostThinkPost(client)
{
    if(
invisible[client] == 1)
    {
        
SetEntProp(clientProp_Send"m_iAddonBits",0);
    }

So I can't use RENDERMODE_NONE bcs I need 20% inv level for player
Are you setting it to an alive/valid player?
headline is offline
hitmany
Senior Member
Join Date: Jul 2010
Old 12-15-2016 , 02:18   Re: [CSGO] Client crash when m_iAddonBits used
Reply With Quote #4

Quote:
Originally Posted by Headline View Post
Are you setting it to an alive/valid player?
Yes
hitmany is offline
hitmany
Senior Member
Join Date: Jul 2010
Old 12-15-2016 , 02:23   Re: [CSGO] Client crash when m_iAddonBits used
Reply With Quote #5

Quote:
Originally Posted by cravenge View Post
Not sure if this still works but how about:
PHP Code:
void InvisibleKnife(int clientint amountbool apply)
{
    
int knife GetPlayerWeaponSlot(clientCS_SLOT_KNIFE);
    if (
knife != -1)
    {
        if (
apply)
        {
            
SetEntityRenderMode(knifeRENDER_TRANSALPHA);
            
SetEntityRenderColor(knife255255255amount);
        }
        else
        {
            
SetEntityRenderMode(knifeRENDER_NONE);
            
SetEntityRenderColor(knife255255255255);
        }
    }

I will try, it will work for attachments like bomb on neck
hitmany is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-15-2016 , 09:43   Re: [CSGO] Client crash when m_iAddonBits used
Reply With Quote #6

Try the addonbits without setting the current weapon's world model. (you need to do that on weapon switch post anyways).
I've had no issues with clients crashing by hiding the addonbits in my custom gamemode.

Last edited by Mitchell; 12-15-2016 at 09:43.
Mitchell is offline
hitmany
Senior Member
Join Date: Jul 2010
Old 12-15-2016 , 09:57   Re: [CSGO] Client crash when m_iAddonBits used
Reply With Quote #7

Quote:
Originally Posted by Mitchell View Post
Try the addonbits without setting the current weapon's world model. (you need to do that on weapon switch post anyways).
I've had no issues with clients crashing by hiding the addonbits in my custom gamemode.
Okay thank you, I will try it too
Looks like fixed(I will test it more). I forget to unhook postthinkpost when client disconnecting
hitmany is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-15-2016 , 10:09   Re: [CSGO] Client crash when m_iAddonBits used
Reply With Quote #8

Quote:
Originally Posted by hitmany View Post
Okay thank you, I will try it too
Looks like fixed(I will test it more). I forget to unhook postthinkpost when client disconnecting
SDKHooks automatically unhooks the client, however you should try hook the post think when the player connects.
Mitchell is offline
hitmany
Senior Member
Join Date: Jul 2010
Old 12-15-2016 , 10:25   Re: [CSGO] Client crash when m_iAddonBits used
Reply With Quote #9

Quote:
Originally Posted by Mitchell View Post
SDKHooks automatically unhooks the client, however you should try hook the post think when the player connects.
maybe, but we did an experiment: Invisible player with SDKHook leaved the server and all players had game crash!
Then I added UnHook in OnClientDisconnect. After this fix no game crashes. No idea why.
hitmany is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-15-2016 , 10:33   Re: [CSGO] Client crash when m_iAddonBits used
Reply With Quote #10

Quote:
Originally Posted by hitmany View Post
maybe, but we did an experiment: Invisible player with SDKHook leaved the server and all players had game crash!
Then I added UnHook in OnClientDisconnect. After this fix no game crashes. No idea why.
Interesting. I'll keep that inmind.
Mitchell is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode