View Single Post
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 01-28-2017 , 13:58   Re: [CS:GO] -N- Arms Fix
Reply With Quote #7

Quote:
Originally Posted by NomisCZ View Post
Just modify these code sections:
PHP Code:
// :: ADD THIS ::
char defaultArms[][] = { "models/weapons/ct_arms.mdl""models/weapons/t_arms.mdl" };
...

public 
Action PlayerSpawn(Event gEventHook, const char[] gEventNamebool iDontBroadcast) {
{
    
int client GetClientOfUserId(gEventHook.GetInt("userid"));
        
// :: ADD THIS ::
        
CreateTimer(0.5PlayerSpawn_Armsclient);
}
// :: ADD THIS ::
public Action PlayerSpawn_Arms(Handle timerint client) {
    
    
GiveArms(client);
}

public 
void GiveArms(int client)
{
    if (!
IsPlayerAlive(client))return;
    
    
int team;
    if(
GetFeatureStatus(FeatureType_Native"ZR_IsClientZombie") == FeatureStatus_Available)
    {
        if (
ZR_IsClientZombie(client))team 0;
        else 
team 1;
    }
    else
        
team GetClientTeam(client);
        
    if(
strlen(g_arms[1][team][client]) > && !StrEqual(g_arms[1][team][client], "none"false) && (FileExists(g_arms[1][team][client]) || FileExists(g_arms[1][team][client], true))) 
    {
        
// :: ADD THIS ::
        
if (StrEqual(g_arms[1][team][client], defaultArms[0]) || StrEqual(g_arms[1][team][client], defaultArms[1]))
            return;
        
SetEntPropString(clientProp_Send"m_szArmsModel"g_arms[1][team][client]);
        
CreateTimer(0.15RemoveItemTimerEntIndexToEntRef(client), TIMER_FLAG_NO_MAPCHANGE);
    }
    
//PrintToChat(client, "modelo arms de %s de %s", g_arms[0][team][client], g_arms[1][team][client]);

And configuration.txt:
PHP Code:
"CustomModels"
{
    
"Default CT Arms"
    
{
        
"model" "models/weapons/ct_arms.mdl"
        "team" "CT"
    
}
    
"Default T Arms"
    
{
        
"model" "models/weapons/t_arms.mdl"
        "team" "TT"
    
}
... 
Don't add -N- Arms Fix code directly into your plugin, because there are many other plugins with arms/gloves functions. So if everyone implement part of my code into its plugin. It can be problematic.

You could add natives to your plugin for a better support in others plugins.
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco