AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set glow on a whole team (https://forums.alliedmods.net/showthread.php?t=127387)

FlyingHorse 05-20-2010 13:14

Set glow on a whole team
 
How do i set glow on a whole team?

#8 SickneSS 05-20-2010 13:21

Re: Set glow on a whole team
 
Code:
#include < fun > //Func new Players[32]; new gNum; get_players( Players, gNum); for(new i; i < gNum; i++) {      //get_team Players[i] instead id                  set_user_rendering( Players[i], kRenderFxGlowShell, RRR, GGG, BBB, kRenderNormal, AMOUNT); }

FlyingHorse 05-20-2010 13:33

Re: Set glow on a whole team
 
This sets glow on everyone .. I just want to know how to set glow on one team.. I don't need a whole plugin, just that part, im gonna add it to my last request plugin

#8 SickneSS 05-20-2010 13:34

Re: Set glow on a whole team
 
yep...

NiQu 05-20-2010 14:04

Re: Set glow on a whole team
 
I would just check if the player is at a specific team at spawn and then give glow.

wrecked_ 05-20-2010 16:02

Re: Set glow on a whole team
 
SickneSS, you forgot to add the team check and alive check.

Quick function to do so:
Code:
SetTeamGlow( CsTeams:Team ) {     new iPlayers[32]     new iNum         get_players( iPlayers, iNum )         new id         for( new i = 0; i < iNum; i++ )     {         id = iPlayers[i]                 if( is_user_alive( id ) && ( cs_get_user_team( id ) == Team ) )         {             set_user_rendering( id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 25 )         }     } }
Usage:
Code:
SetTeamGlow( CS_TEAM_CT )

#8 SickneSS 05-20-2010 23:35

Re: Set glow on a whole team
 
Yes,i forgot,sorry,btw,in your code you sets a same glow color,i modify your code...
Code:
stock cs_set_team_glow(const iTeam,const RRR,const GGG,const BBB,const AMMOUNT) {     new iPlayers[32];     new iNum;     get_players(iPlayers, iNum);         for(new i = 0; i < iNum; i++)     {         new Indx = Players[i];                 if(is_user_alive(Indx) && (cs_get_user_team(Indx) == iTeam)             set_user_rendering( id, kRenderFxGlowShell, RRR, GGG, BBB, kRenderNormal, AMMOUNT );     } }

wrecked_ 05-20-2010 23:46

Re: Set glow on a whole team
 
Code:
SetTeamGlow( CsTeams:Team, r=255, g=0, b=0, amt=25 ) {     new iPlayers[32]     new iNum         get_players( iPlayers, iNum )         new id         for( new i = 0; i < iNum; i++ )     {         id = iPlayers[i]                 if( is_user_alive( id ) && ( cs_get_user_team( id ) == Team ) )         {             set_user_rendering( id, kRenderFxGlowShell, r, g, b, kRenderNormal, amt )         }     } }
Code:
SetTeamGlow( CS_TEAM_T, 100, 200, 50, 17 ) // or SetTeamGlow( CS_TEAM_T )
2nd - 5th parameters are optional. If you do not provide them in the function call then your glow will appear as red.

fysiks 05-21-2010 00:12

Re: Set glow on a whole team
 
Perhaps a good stock would be something like:

Code:

stock set_team_rendering( CsTeams:Team, kRender = kRenderNormal, r=0, g=0, b=0, amt=0 )
This way set_team_rendering(team) will work like set_user_rendering(id).

#8 SickneSS 05-21-2010 02:11

Re: Set glow on a whole team
 
Something like...

Code:
stock set_team_glow(iTeam, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 20) {     new Float:color[3];     color[0] = Float:r;     color[1] = Float:g;     color[2] = Float:b;     new iPlayers[32];     new iNum;     get_players(iPlayers, iNum);         new index;         for(new i = 0;i < iNum; i++)     {         index = Players[i];                 if(is_user_alive(index) && cs_get_user_team(index) == iTeam)         {             set_pev(index,pev_renderfx,kRenderFxGlowShell);             set_pev(index,pev_rendercolor,color);             set_pev(index,pev_rendermode,render);             set_pev(index,pev_renderamt,amount);         }     }     return 1; }
?
Not tested
if u use it,needs #include <cstrike>


All times are GMT -4. The time now is 03:54.

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