Raised This Month: $ Target: $400
 0% 

How to switch a player of team in game without slaying him ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
speedycvc
New Member
Join Date: Jun 2006
Old 06-21-2006 , 07:33   How to switch a player of team in game without slaying him ?
Reply With Quote #1

Hi, I want to know if I am not wrong about this idea:
I want to switch a player for example a terror in ct team, he is alive and I want to switch Him by the team menu. Evidently, I want to switch him without slaying him.

I think this is in the player menu. sma that I have to change something.

In this plug I find:

/* Team menu */

....
....
....
....

switch (get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"%L",id,"ADMIN_TRAN SF_2",name,name2,g_menuOption[id] ? "TERRORIST" : "CT" )
case 1: client_print(0,print_chat,"%L",id,"ADMIN_TRAN SF_1",name2,g_menuOption[id] ? "TERRORIST" : "CT" )
}

new limitt = get_cvar_num("mp_limitteams")
set_cvar_num("mp_limitteams",0)
user_kill(player,1) I think that I have to change the value to "0"
engclient_cmd(player, "chooseteam")
engclient_cmd(player, "menuselect", g_menuOption[id] ? "1" : "2" )
engclient_cmd(player, "menuselect", "5")
client_cmd(player,"slot1")
set_cvar_num("mp_limitteams",limitt)

displayTeamMenu(id,g_menuPosition[id])


Do you think that it's all ?
speedycvc is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 06-21-2006 , 07:37  
Reply With Quote #2

Wait to execute it until you know the user has died or the end of the round.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-21-2006 , 07:39  
Reply With Quote #3

Code:
/* Set user team without killing player.  * If model is anything other than CS_DONTCHANGE, that will be set as player's model.  */ native cs_set_user_team(index, {CsTeams,_}:team, {CsInternalModel,_}:model = CS_DONTCHANGE); eg. cs_set_user_team(id, CS_TEAM_CT)
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
speedycvc
New Member
Join Date: Jun 2006
Old 06-21-2006 , 07:51  
Reply With Quote #4

Quote:
Originally Posted by SweatyBanana
Wait to execute it until you know the user has died or the end of the round.
SweatyBanana it is really interessant, but I know that! This IS exactly why I search a different solution!
Cheap_Suit I don't understand where I put this script? Is it an independant ittle plug to compile ?
speedycvc is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-21-2006 , 08:03  
Reply With Quote #5

Remove all of this:
Code:
engclient_cmd(player, "chooseteam") engclient_cmd(player, "menuselect", g_menuOption[id] ? "1" : "2" ) engclient_cmd(player, "menuselect", "5") client_cmd(player,"slot1")

and add this
Code:
cs_set_user_team(id, g_menuOption[id])

and include cstrike:
Code:
#include <cstrike>
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-21-2006 , 09:37  
Reply With Quote #6

Actually should be
Code:
cs_set_user_team(player, g_menuOption[id] ? CS_TEAM_T : CS_TEAM_CT)
Because g_menuOption[id] can be 1 or 0, and you need CsTeams:1 or CsTeams:2.
CsTeams tag is needed because obviously that he is using old amxx version (take a look at the code) and old cstrike.inc doesn't support untagged team variable for cs_set_user_team native.
VEN 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 07:59.


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