Raised This Month: $ Target: $400
 0% 

Team Change Event


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
raa
Senior Member
Join Date: Oct 2005
Old 06-12-2007 , 14:37   Team Change Event
Reply With Quote #1

Hi, I need help with detecting when a player changes a team(including SPEC). Also, either within that function or using another method I need to detect team changes within one round as well. This is for CS1.6

I've tried using client_infochanged but it detects more then just team change.
like so..

Code:
public client_infochanged(id)     {         if(cs_get_user_team(id)==CS_TEAM_CT)         {         client_print(id,print_chat,"CT");         }     else if(cs_get_user_team(id)==CS_TEAM_T)         {         client_print(id,print_chat,"TERRORIST");         }     return PLUGIN_CONTINUE }

Here are some other functions I've got

Code:
public event_new_round()     {     log_amx("NEWROUND EVENT TRIGGERED")             new players[32], num     get_players(players, num,"e","SPECTATOR");             for (new i; i < num; ++i)         {         new is_PLAYER_SPEC = cs_get_user_team(players[i]) == CS_TEAM_SPECTATOR         if(is_PLAYER_SPEC)             {             log_amx("PLAYER WENT SPEC")         }     }     return PLUGIN_CONTINUE }
That seems to think you went spec even when you didn't.

I've also tried making a check function on spawn
Code:
public check_team(id)     {     new newteam[33]     get_user_team(id, newteam, 32 )             if(!equali(newteam,stored_team))         {         // DO TASK     }     return PLUGIN_CONTINUE }
And on deathmsg doing "get_user_team(victim, stored_team, 32 )" to store the team for compare on spawn.


anyway, can anyone help me with the best way to do this?
__________________

Last edited by raa; 06-12-2007 at 14:42.
raa is offline
 



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 21:07.


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