In the function
Code:
public actionTeamMenu(id,key)
Maybe you must add some code for cstrike servers.
The reason is that if you transfer an alive CT player to T
he will change to a T model and still run arround and kill Terror until the round has ended
It is like a mole or chameleon in UWC3
The code you could add is
Code:
#if defined CSTRIKE
if(is_user_alive(player)) {
client_print(id,print_chat,"You cant transfer alive players")
displayTeamMenu(id,g_menuPosition[id])
return PLUGIN_HANDLED
}
#endif
Or maybe kill the player, but that would maybe not be popular
Code:
#if defined CSTRIKE
if(is_user_alive(player)) {
user_kill(player,1)
}
#endif
Now the beginning of the function will look like this
Code:
public actionTeamMenu(id,key) {
switch (key) {
case 7:{
g_menuOption[id] = 1 - g_menuOption[id]
displayTeamMenu(id,g_menuPosition[id])
}
case 8: displayTeamMenu(id,++g_menuPosition[id])
case 9: displayTeamMenu(id,--g_menuPosition[id])
default: {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new authid[32],authid2[32], name[32], name2[32]
get_user_name(player,name2,31)
get_user_authid(id,authid,31)
#if defined CSTRIKE
if(is_user_alive(player)) {
client_print(id,print_chat,"You cant transfer alive players")
displayTeamMenu(id,g_menuPosition[id])
return PLUGIN_HANDLED
}
#endif
get_user_authid(player,authid2,31)
get_user_name(id,name,31)
And also the bug you fixxed with the TEam menu not updating
I feel that it should be the other way arround
The menu don't show the players current team, but the team that he can be transfered to.
In CVS Revision 1.25
The code you added in 2 places .. (the second place has a little diffrent code)
Code:
#if defined CSTRIKE
if (cs_get_user_team(i) == CS_TEAM_T)
{
copy(team, 3, "CT") // <------- There
} else if (cs_get_user_team(i) == CS_TEAM_CT) {
copy(team, 3, "TE") // <------- There
} else {
get_user_team(i,team,3)
}
#else
get_user_team(i,team,3)
#endif
Change to this
Code:
#if defined CSTRIKE
if (cs_get_user_team(i) == CS_TEAM_T)
{
copy(team, 3, "TE")
} else if (cs_get_user_team(i) == CS_TEAM_CT) {
copy(team, 3, "CT")
} else {
get_user_team(i,team,3)
}
#else
get_user_team(i,team,3)
#endif
I have tested this and it seems to work perfect now.
Hope you think this is alright.
..
__________________