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

CS GO: Remove Knife !


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
arbol
Junior Member
Join Date: Sep 2013
Location: Argentina
Old 12-24-2015 , 20:11   CS GO: Remove Knife !
Reply With Quote #1

Hello.
I have a custom player model, which ideally wouldn't show a knife (i want the weapon to be transparent). See img below.

My previous strategy was to replace the knife with a small black dot, which worked till some SM versions ago.

My actual strategy is the following, which doesn't work:
Code:
public Action:Command_test(client, args) //..
{
  for(new h = 1; h <= MaxClients; h++)
  {
        if(IsClientInGame(h))
        {
            SDKHookEx(h, SDKHook_PostThinkPost, OnPostThinkPost);
            //SetEntProp(client, Prop_Send, "m_nRenderFX", RENDERFX_NONE);
            //SetEntProp(client, Prop_Send, "m_nRenderMode", RENDER_NONE);
        }
  }
  removeKnife();
}

public removeKnife(){
    new entity = MaxClients+1;

    while( (entity = FindEntityByClassname2(entity, "weaponworldmodel")) != -1 )
    {
        SetEntProp(entity, Prop_Send, "m_nModelIndex", 0);
    }
    PrintToChatAll("removido weaponworldmodel");
}


FindEntityByClassname2(sStartEnt, String:szClassname[])
{
    while (sStartEnt > -1 && !IsValidEntity(sStartEnt)) sStartEnt--;
    return FindEntityByClassname(sStartEnt, szClassname);
}


public OnPostThinkPost(client)
{
    //SetEntProp(client, Prop_Send, "m_iPrimaryAddon", CSAddon_NONE);
    //SetEntProp(client, Prop_Send, "m_iSecondaryAddon", CSAddon_NONE);
    SetEntProp(client, Prop_Send, "m_iAddonBits", CSAddon_NONE);
}
I mean, it DOES remove the knife, but also corrupts the custom model somehow, making it buggy, showing the "ragdoll" stance randomly...

I also tried this (this one does nothing ) :
Code:
public PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new client=GetClientOfUserId(GetEventInt(event, "userid"))
    SetEntityRenderFx(client,RENDERFX_DISTORT)
    new KnifeEnt=GetPlayerWeaponSlot(client,_:2)
    if(KnifeEnt!=-1){
        SetEntityRenderFx(KnifeEnt,RENDERFX_DISTORT)
        SetEntProp(KnifeEnt, Prop_Send, "m_nModelIndex", 0)                                     }
}  
So the question: is there a way to hide the knife, without corrupting the custom player model ? why does removing the knife corrupts it anyway?



Thanks as always for your help
Merry christmas


http://************/image/kazzfvgnb/

Last edited by arbol; 12-24-2015 at 20:20.
arbol is offline
 



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 01:15.


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