AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set a users team (https://forums.alliedmods.net/showthread.php?t=57773)

djmd378 07-10-2007 23:59

set a users team
 
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.

[X]-RayCat 07-11-2007 07:50

Re: set a users team
 
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..

Arkshine 07-11-2007 08:00

Re: set a users team
 
Using TeamInfo I assume. http://wiki.alliedmods.net/Half-Life...vents#TeamInfo

djmd378 07-11-2007 19:36

Re: set a users team
 
Quote:

Originally Posted by arkshine (Post 502010)

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.

djmd378 07-15-2007 13:00

Re: set a users team
 
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?

Wilson [29th ID] 07-17-2007 19:44

Re: set a users team
 
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.

djmd378 07-17-2007 22:34

Re: set a users team
 
Quote:

Originally Posted by Wilson [29th ID] (Post 504618)
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

_Master_ 07-18-2007 14:24

Re: set a users team
 
Quote:

Originally Posted by djmd378 (Post 503654)
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.

djmd378 07-18-2007 21:23

Re: set a users team
 
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) }

Rolnaaba 07-19-2007 22:04

Re: set a users team
 
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 };


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

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