AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Team color sprite! (https://forums.alliedmods.net/showthread.php?t=159174)

Podarok 06-13-2011 15:13

Team color sprite!
 
Hello! Please help me! I wanted to make this sprite in team colors, but while compiling I got tag mismatch! Please help me fixing it!
PHP Code:

// Create the lightning
    
new id CS_TEAM_T
    
if ( cs_get_user_team(id) )
    
Create_TE_BEAMENTSiCasteriTargetg_iSprites[SPR_LIGHTNING], 01510iLineWidth100255255255);
    else 
    
Create_TE_BEAMENTSiCasteriTargetg_iSprites[SPR_LIGHTNING], 01510iLineWidth1002550255); 


Clauu 06-13-2011 15:57

Re: Team color sprite!
 
Code:

new id = CS_TEAM_T
   
if ( cs_get_user_team(id) )


wth is this? id is a player index.

Podarok 06-13-2011 16:03

Re: Team color sprite!
 
Yes, I know, but, if i write just without new id = CS_TEAM_T , then I will get undefined symbol!

Devil259 06-13-2011 16:07

Re: Team color sprite!
 
Don't forget to include cstrike.

Code:
new players[ 32 ] , num , i , id get_players( players , num ) for( i = 0; i < num; i++ ) {      id = players[ i ]      new CsTeams:team = cs_get_user_team( id )      switch( team )      {           case CS_TEAM_T: // blabla           case CS_TEAM_CT: //blabla      } }

Clauu 06-13-2011 16:08

Re: Team color sprite!
 
Because you must have that id, it depends of what kind of function do you have.

LE:
see Devil259's posted code.

Podarok 06-13-2011 16:19

Re: Team color sprite!
 
Omfg, you're my hero! IT WORKS! THANKS A LOT! (@ - Devil259 )

Podarok 06-13-2011 16:30

Re: Team color sprite!
 
But, again problem, in game it mixses two colors together whether the team is T or CT...

Podarok 06-13-2011 16:31

Re: Team color sprite!
 
Maybe that is because all the plugin uses get_user_team and here I insered cs_get_user_team? Can you make it with get_user_team please?

Devil259 06-14-2011 03:30

Re: Team color sprite!
 
I don't think using get_user_team will work better...

Podarok 06-14-2011 07:11

Re: Team color sprite!
 
So, then why is he mixing up this two colors? I have made blue for CT and red for T, and in result my sprite has mixed up and now it is violet... Any idea?


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

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