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

[CSGO] Weapon colors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 11-09-2015 , 18:31   [CSGO] Weapon colors
Reply With Quote #1

Hello! Is there a way to put a color on an weapon in csgo ?
I have this code, but doesn't work:

PHP Code:
// EditPlus

#include <sourcemod>

#define VERSION "1.0"

public Plugin:myinfo =
{
    
name "Name",
    
author "Hades Ownage",
    
description "Description",
    
version VERSION,
    
url "http://forums.alliedmods.net"
};

new 
weaponOffset;

public 
OnPluginStart()
{
    
CreateConVar("sm_name_version"VERSION"Name Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);

    
RegConsoleCmd "sm_color"CommandColor );

    
weaponOffset FindSendPropInfo("CBasePlayer","m_hMyWeapons");

}

public 
ActionCommandColor clientargs ) {

    
// code from Store: Weapon Colors
    
new ent = -1;
    for(new 
0<= 47i++) { 
        
ent GetEntDataEnt2(client,weaponOffset + (4)); 

        if ( 
ent != -) {
            
            
SetEntityRenderColor(ent2552550255);
            
SetEntityRenderMode(entRenderMode:1);

        }
        
    }

Thank you!
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
Msalinas2877
Member
Join Date: Oct 2015
Location: Chile
Old 11-09-2015 , 19:34   Re: [CSGO] Weapon colors
Reply With Quote #2

PHP Code:
public ActionCommandColor clientargs )
{
            new 
weapon GetEntPropEnt(clientProp_Send"m_hActiveWeapon");  

            
SetEntityRenderColor(weapon2552550255); 
            
SetEntityRenderMode(weaponRENDER_NORMAL); 

__________________

Last edited by Msalinas2877; 11-09-2015 at 19:37.
Msalinas2877 is offline
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 11-10-2015 , 03:36   Re: [CSGO] Weapon colors
Reply With Quote #3

Don't work.
I also tired with Entity_SetRenderColor (smlib), but also don't work.

Last edited by hadesownage; 11-10-2015 at 03:36.
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
lingzhidiyu
Senior Member
Join Date: Mar 2014
Old 11-10-2015 , 05:33   Re: [CSGO] Weapon colors
Reply With Quote #4

you cant set activeweapon color/alpha after csgo update.
lingzhidiyu is offline
Msalinas2877
Member
Join Date: Oct 2015
Location: Chile
Old 11-10-2015 , 05:44   Re: [CSGO] Weapon colors
Reply With Quote #5

Yes but they added a cvar

Quote:
– Added a convar (sv_disable_immunity_alpha) that when set, allows mods to handle their own alpha on players.
__________________

Last edited by Msalinas2877; 11-10-2015 at 05:44.
Msalinas2877 is offline
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 11-10-2015 , 10:56   Re: [CSGO] Weapon colors
Reply With Quote #6

Quote:
Originally Posted by Msalinas2877 View Post
Yes but they added a cvar
I already have this cvar with the value 1, but still doesn't work.
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 11-10-2015 , 12:27   Re: [CSGO] Weapon colors
Reply With Quote #7

Alpha is transparency, not color.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-10-2015 , 13:37   Re: [CSGO] Weapon colors
Reply With Quote #8

Quote:
Originally Posted by Powerlord View Post
Alpha is transparency, not color.
also that cvar is for the player's alpha, people keep posting it however in threads about weapons.
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 08:19.


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