Raised This Month: $ Target: $400
 0% 

set a users team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-19-2007 , 22:04   Re: set a users team
Reply With Quote #1

um set the player's team without changing their model:
Code:
cs_set_user_team(id, CS_TEAM_T, CS_DONTCHANGE);

from cstrike.inc:
Code:
native cs_set_user_team(index, {CsTeams,_}:team, {CsInternalModel,_}:model = CS_DONTCHANGE); enum CsInternalModel {     CS_DONTCHANGE = 0,     CS_CT_URBAN = 1,     CS_T_TERROR = 2,     CS_T_LEET = 3,     CS_T_ARCTIC = 4,     CS_CT_GSG9 = 5,     CS_CT_GIGN = 6,     CS_CT_SAS = 7,     CS_T_GUERILLA = 8,     CS_CT_VIP = 9,     CZ_T_MILITIA = 10,     CZ_CT_SPETSNAZ = 11 }; enum CsTeams {     CS_TEAM_UNASSIGNED = 0,     CS_TEAM_T = 1,     CS_TEAM_CT = 2,     CS_TEAM_SPECTATOR = 3 };
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
djmd378
Senior Member
Join Date: Sep 2004
Old 07-20-2007 , 02:30   Re: set a users team
Reply With Quote #2

Oh wow, I can't believe I never noticed the CS_DONTCHANGE. Thanks, I'll test this out when I get a chance.
__________________
djmd378 is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 07-20-2007 , 06:27   Re: set a users team
Reply With Quote #3

PHP Code:
stock fm_cs_set_user_team(indexteamflag 1){ 
    new 
teams[12
 
    if(!
pev_valid(index)) return 
 
    set_pdata_int
(index114team
 
    if(
flag){ 
        
dllfunc(DLLFunc_ClientUserInfoChangedindexengfunc(EngFunc_GetInfoKeyBufferindex)) 
 
        switch(
team){ 
            case 
0copy(teams11"UNASSIGNED"
            case 
1copy(teams11"TERRORIST"
            case 
2copy(teams11"CT"
            case 
3copy(teams11"SPECTATOR"
        } 
 
        
message_begin(MSG_ALLget_user_msgid("TeamInfo"), {000}, 0
        
write_byte(index
        
write_string(teams
        
message_end() 
    } 
 
    return 



This one works fine.
Set the flag to 0 if you want to make a "hidden" team change (team update is NOT shown - bots WILL "see" the change)

Last edited by _Master_; 07-20-2007 at 06:41.
_Master_ is offline
djmd378
Senior Member
Join Date: Sep 2004
Old 07-20-2007 , 20:56   Re: set a users team
Reply With Quote #4

Quote:
Originally Posted by _Master_ View Post
This one works fine.
Set the flag to 0 if you want to make a "hidden" team change (team update is NOT shown - bots WILL "see" the change)
I know that useing set_pdata_int works, just that it crashes the server when you transfer a lot of players at the same time.


Also this doesn't work for some reason
Code:
    cs_set_user_team(id, CS_TEAM_T, CS_DONTCHANGE)     cs_set_user_team(id, CS_TEAM_CT, CS_DONTCHANGE)
__________________
djmd378 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 21:33.


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