Raised This Month: $ Target: $400
 0% 

CsTeams


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-16-2010 , 17:55   Re: CsTeams
Reply With Quote #1

If you are not checking it very often though, you should just abandon the array altogether and simply do:
Code:
if ( cs_get_user_team( id ) == CS_TEAM_CT )
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 11-16-2010 , 21:58   Re: CsTeams
Reply With Quote #2

Quote:
Originally Posted by Bugsy View Post
That is an array for all players currently on the server, you need to assign each element of the array for each individual player; each cs_get_user_team() call is only for a single player.

If you need to constantly have all player teams populated into the array then you can hook TeamInfo.

untested
PHP Code:
#include <amxmodx>
#include <cstrike>

new g_iOldTeam33 ];
new 
CsTeams:g_iTeam33 ];

public 
plugin_init() 
{
    
register_event"TeamInfo" "fw_EvTeamInfo" "a" );
}

public 
fw_EvTeamInfo()
{
    new 
szTeam] , iPlayer read_data);
    
    
read_dataszTeam charsmaxszTeam ) );
    
    if( 
szTeam] != g_iOldTeamiPlayer ] )
    {
        switch ( 
szTeam] )
        {
            case 
'U'g_iTeamiPlayer ] = CS_TEAM_UNASSIGNED;
            case 
'T'g_iTeamiPlayer ] = CS_TEAM_T;
            case 
'C'g_iTeamiPlayer ] = CS_TEAM_CT;
            case 
'S'g_iTeamiPlayer ] = CS_TEAM_SPECTATOR;
        }    
        
        
g_iOldTeamiPlayer ] = szTeam];
    }

Quote:
Originally Posted by Emp` View Post
If you are not checking it very often though, you should just abandon the array altogether and simply do:
Code:
if ( cs_get_user_team( id ) == CS_TEAM_CT )

thank you very much
shuttle_wave 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 11:14.


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