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

[REQ] Color player models by team color?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Friskybitch
Junior Member
Join Date: Jan 2015
Old 01-17-2015 , 12:57   [REQ] Color player models by team color?
Reply With Quote #1

I'd like CT, regardless of model, to be blue. And T to be red.
Example:


Either like that or with a blue/red glow.
This would be useful so that both teams can buy the same skin in my store, without being confused because both teams have the same model.

Does anyone know what plugin this?

Last edited by Friskybitch; 01-17-2015 at 12:57.
Friskybitch is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 01-18-2015 , 01:14   Re: [REQ] Color player models by team color?
Reply With Quote #2

OnPlayerSpawn, check if client is alive and if they are, give them the color using SetEntityRenderColor based on which number is given using GetClientTeam.
Drixevel is offline
Friskybitch
Junior Member
Join Date: Jan 2015
Old 01-18-2015 , 03:38   Re: [REQ] Color player models by team color?
Reply With Quote #3

I can't code.
Friskybitch is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 01-18-2015 , 04:20   Re: [REQ] Color player models by team color?
Reply With Quote #4

Quote:
Originally Posted by Friskybitch View Post
I can't code.
Yes you can ! Put the block in correct order !
Spoiler

Let me know if you sucessfully did it.
__________________
Want to check my plugins ?

Last edited by Arkarr; 01-18-2015 at 04:24.
Arkarr is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 01-18-2015 , 05:50   Re: [REQ] Color player models by team color?
Reply With Quote #5

PHP Code:
if(GetClientTeam(client) == TEAM_CT)
            
red 0;
        else if(
GetClientTeam(client) == TEAM_T)
            
blue 0

That could work but you could also do this:

PHP Code:
switch (GetClientTeam(client))
{
    case 
TEAM_CTred 0;
    case 
TEAM_Tblue 0;

In my eyes though, I wouldn't use predefined variables with values in this case because you could just use those values in the function that sets their colors.

PHP Code:
switch (GetClientTeam(client))
{
    case 
TEAM_CTSetEntityRenderColor(client00255);
    case 
TEAM_TSetEntityRenderColor(client25500);

Drixevel is offline
Friskybitch
Junior Member
Join Date: Jan 2015
Old 01-18-2015 , 14:46   Re: [REQ] Color player models by team color?
Reply With Quote #6

Thank you so much both of you! I made it all work.
Spoiler


One small problem though.. I have a couple addons that also changes the players color on certain events. (Spawn protection, knife fight etc.). Whenever those events are over, they remove the color. Is there any way to make those plugins compatible with this, without having to edit all the other plugins?
Attached Files
File Type: 7z colorteams.7z (4.5 KB, 420 views)

Last edited by Friskybitch; 01-18-2015 at 15:08.
Friskybitch is offline
Chesterfield
Senior Member
Join Date: Apr 2013
Old 01-18-2015 , 16:59   Re: [REQ] Color player models by team color?
Reply With Quote #7

This is such a great idea and a great plugin, and i have a little request which i'm sure someone will like, some people loves this plugin, it's "easier" for them to play with it, but for others, it's worse since they don't feel comfortable.

So what i'm asking, maybe it's possible, is if you could make a cvar, a chat command that will turn it on and off, for example "!colour" will disable or enable this plugin, which means, people will be abble to decide if they want characters with that colour or not (and their decision will be saved, just like with !quake sounds)

Could this be possible? it would help alot and it will be much better for many users, thanks in advanced!

Last edited by Chesterfield; 01-18-2015 at 17:00.
Chesterfield is offline
The1Speck
SourceMod Donor
Join Date: Oct 2014
Location: USA
Old 01-18-2015 , 20:11   Re: [REQ] Color player models by team color?
Reply With Quote #8

Quote:
Originally Posted by Chesterfield View Post
This is such a great idea and a great plugin, and i have a little request which i'm sure someone will like, some people loves this plugin, it's "easier" for them to play with it, but for others, it's worse since they don't feel comfortable.

So what i'm asking, maybe it's possible, is if you could make a cvar, a chat command that will turn it on and off, for example "!colour" will disable or enable this plugin, which means, people will be abble to decide if they want characters with that colour or not (and their decision will be saved, just like with !quake sounds)

Could this be possible? it would help alot and it will be much better for many users, thanks in advanced!
No.
__________________

Add me on Steam for personal inquiries or direct assistance.
The1Speck is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 01-18-2015 , 22:25   Re: [REQ] Color player models by team color?
Reply With Quote #9

Quote:
Originally Posted by The1Speck View Post
No.
Yes, it's possible.

Last edited by Sreaper; 01-18-2015 at 22:25.
Sreaper is offline
shadowdragon
Senior Member
Join Date: Dec 2012
Old 01-18-2015 , 22:48   Re: [REQ] Color player models by team color?
Reply With Quote #10

I don't want to seem rude but if you used the search bar you would have found my plugin
https://forums.alliedmods.net/showthread.php?t=202839
But im glad your happy, i love the alliedmodders forum everyone is so helpful its differently one of the best forums if signed up for!
__________________
Sorry for my poor English!
________________________________
I can do CSS/CSGO plugin request for little money!
shadowdragon 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 12:31.


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