Raised This Month: $ Target: $400
 0% 

[TF2] Setting Class Render Color


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MLGsuperGame
Member
Join Date: Mar 2012
Location: Jamaica
Old 01-18-2016 , 18:26   [TF2] Setting Class Render Color
Reply With Quote #1

I'm attempting make snipers a bit less transparent to make them blend in better, I cant seem to get it right though, this is what I'm working with, can I get any assistance? This block is from player_spawn event. Im simply trying to run a check to see if the players class is sniper and if it is change their render color.

Code:
 new IsSniper = TF_GetClass("sniper")
 if IsSniper = true
  SetEntityRenderColor(client, 100, 100, 100, 100)
__________________
MLGsuperGame is offline
zyox123cc
Senior Member
Join Date: Jul 2016
Location: spycrab
Old 10-03-2016 , 05:49   Re: [TF2] Setting Class Render Color
Reply With Quote #2

Try this https://forums.alliedmods.net/showthread.php?t=75520
zyox123cc is offline
Mayor Gamer
Senior Member
Join Date: Nov 2012
Location: GetLocationOfUser(me);
Old 10-03-2016 , 21:43   Re: [TF2] Setting Class Render Color
Reply With Quote #3

Made this in 3 minutes. Didn't test it. This is what you need?

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <tf2>
#include <tf2_stocks>

public Plugin myinfo =
{
    
name "[TF2] Sniper Render Color",
    
author "Lucas 'aIM' Maza",
    
version "0x0"
};

public 
void OnPluginStart()
{
    
HookEvent("player_spawn"OnPlayerSpawn);
}

public 
Action OnPlayerSpawn (Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
TFClassType class = TF2_GetPlayerClass(client);
    
    if (class == 
TFClass_Sniper && IsValidEntity(client))
        
SetEntityRenderColor(client100100100100);

__________________
Mayor Gamer is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 10-04-2016 , 03:57   Re: [TF2] Setting Class Render Color
Reply With Quote #4

to set alpha, you need to use rendermode trans or transadd
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 01:52.


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