Raised This Month: $ Target: $400
 0% 

set a users team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
djmd378
Senior Member
Join Date: Sep 2004
Old 07-10-2007 , 23:59   set a users team
Reply With Quote #1

Is there a way to set a users team (for cs1.6) without changing their model?

For example, Player joins CT and has SAS model. I force them to Terrorist but they still have the SAS model.

I know I can just change their model to SAS once they are moved to Terrorist but I want to find a way of doing this without resetting the model.
__________________
djmd378 is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 07-11-2007 , 07:50   Re: set a users team
Reply With Quote #2

Umh it wont change the model if you force it alive. You could set the forced players model.

EDIT: Ehh, you didnt want to reset. sorry nvm..
[X]-RayCat is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-11-2007 , 08:00   Re: set a users team
Reply With Quote #3

Using TeamInfo I assume. http://wiki.alliedmods.net/Half-Life...vents#TeamInfo
__________________
Arkshine is offline
djmd378
Senior Member
Join Date: Sep 2004
Old 07-11-2007 , 19:36   Re: set a users team
Reply With Quote #4

Quote:
Originally Posted by arkshine View Post
Code:
    message_begin(MSG_ALL, get_user_msgid("TeamInfo"), {0,0,0}, 0)     write_byte(id)     write_string("CT")     message_end()

That only changes the score board, but it doesn't actually transfer them to the other team.


EDIT: I found out how to do this now. Have to use set_pdata_int. Thanks for helping though.
__________________

Last edited by djmd378; 07-11-2007 at 19:47.
djmd378 is offline
djmd378
Senior Member
Join Date: Sep 2004
Old 07-15-2007 , 13:00   Re: set a users team
Reply With Quote #5

It seems that if I use set_pdata_int to change large amounts of player's team then it will crash the server. Anyone have a solution to this? Or even another method of what I want to do?
__________________
djmd378 is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 07-18-2007 , 14:24   Re: set a users team
Reply With Quote #6

Quote:
Originally Posted by djmd378 View Post
It seems that if I use set_pdata_int to change large amounts of player's team then it will crash the server. Anyone have a solution to this? Or even another method of what I want to do?
Post the code for this issue.
_Master_ is offline
djmd378
Senior Member
Join Date: Sep 2004
Old 07-18-2007 , 21:23   Re: set a users team
Reply With Quote #7

I dunno why you need this but....

Code:
stock md_set_user_team(index, team) {     message_begin(MSG_ALL, get_user_msgid("TeamInfo"), {0,0,0}, 0)     write_byte(index)     write_string((team == 1) ? "TERRORIST" : "CT")     message_end()     set_pdata_int(index, 114, team) }
__________________
djmd378 is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 07-17-2007 , 19:44   Re: set a users team
Reply With Quote #8

set_pev( id, pev_team, 1 )

Replace 1 with the team value, or the team const (ie. CT, TERRORSTS, whatever you cs'ers use)

This does exactly what you want I do it in DoD all the time.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
djmd378
Senior Member
Join Date: Sep 2004
Old 07-17-2007 , 22:34   Re: set a users team
Reply With Quote #9

Quote:
Originally Posted by Wilson [29th ID] View Post
set_pev( id, pev_team, 1 )

Replace 1 with the team value, or the team const (ie. CT, TERRORSTS, whatever you cs'ers use)

This does exactly what you want I do it in DoD all the time.

pev_team doesn't seem to work for me.

I've tried
PHP Code:

        set_pev
(idpev_team"CT")
        
set_pev(idpev_team"TERRORSTS")

          
set_pev(idpev_team"CS_TEAM_CT")
          
set_pev(idpev_team"CS_TEAM_T")

          
set_pev(idpev_teamCS_TEAM_CT)
          
set_pev(idpev_teamCS_TEAM_T)

           
set_pev(idpev_team2)
           
set_pev(idpev_team1
All seem to have failed
__________________
djmd378 is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-19-2007 , 22:04   Re: set a users team
Reply With Quote #10

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
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