Raised This Month: $51 Target: $400
 12% 

[HELP] Moving from spec to team issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoldNux
Senior Member
Join Date: Mar 2018
Old 05-12-2018 , 12:29   [HELP] Moving from spec to team issue
Reply With Quote #1

When I use cs_set_user_team to move a player from spec to a team.
That player spawns with a glitched hud and some features disabled.

Anyone know how to move from spec to team properly to avoid this?

Thanks.
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 05-12-2018 at 12:29.
GoldNux is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-12-2018 , 12:36   Re: [HELP] Moving from spec to team issue
Reply With Quote #2

Not sure if this will fix it but try ExecuteHam( Ham_CS_RoundRespawn , id )
__________________
Bugsy is offline
GoldNux
Senior Member
Join Date: Mar 2018
Old 05-12-2018 , 16:32   Re: [HELP] Moving from spec to team issue
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Not sure if this will fix it but try ExecuteHam( Ham_CS_RoundRespawn , id )
Where is the best place to insert that?

Players being transferred to spec from a team, and then assigned to a team are not experiencing any problems.
It's when you are already in spec, and then transferred to a team that this issue occurs.
Note that there is a line preventing spectators from being moved to spec, so this is not the issue.

Thank you.

Code:
public balance(id, level, cid) {     if (!cmd_access(id, level, cid, 2))     {         return PLUGIN_HANDLED     }     new arg1[4]     read_argv(1, arg1, charsmax(arg1))     randPercent = str_to_num(arg1)     new players[32]     new playercount     get_players(players, playercount)     SortCustom1D(players, playercount, "compareByKD")     new i     for (i = 0; i < playercount; i++)     {         new id = players[i]         if (!is_user_hltv(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR)         {             cs_set_user_team(id, CS_TEAM_SPECTATOR)                         new data[2]             data[0] = id             data[1] = i             set_task((1.0 * i) + 4.0, "assignUserTeam", _, data, sizeof(data))         }     }         set_task((1.0 * i) + 4.0, "restartRound")     return PLUGIN_CONTINUE } public restartRound() {     console_cmd(0, "sv_restart 1") } public assignUserTeam(data[]) {     new id = data[0]     new order = data[1]     cs_set_user_team(id, order % 2 == 0 ? CS_TEAM_CT : CS_TEAM_T)     new name[40]     get_user_name(id, name, 40)         console_cmd(0,"say %s has a kill / death ratio of: %f", name, getKD(id)) }
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 05-12-2018 at 16:42.
GoldNux is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-12-2018 , 18:02   Re: [HELP] Moving from spec to team issue
Reply With Quote #4

After you set the team
PHP Code:
cs_set_user_team(idorder == CS_TEAM_CT CS_TEAM_T
__________________
Bugsy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-12-2018 , 18:13   Re: [HELP] Moving from spec to team issue
Reply With Quote #5

This problem happens when player is blocked from his 1st join try executing jointeam command on the player, and the team number as its 1st argument.

In get_players(players, playercount)

You can pass in 3rd param flag h to skip retrieving hltv
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-12-2018 at 18:17.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
GoldNux
Senior Member
Join Date: Mar 2018
Old 05-13-2018 , 07:19   Re: [HELP] Moving from spec to team issue
Reply With Quote #6

Quote:
Originally Posted by Natsheh View Post
This problem happens when player is blocked from his 1st join try executing jointeam command on the player, and the team number as its 1st argument.

In get_players(players, playercount)

You can pass in 3rd param flag h to skip retrieving hltv
Thank you guys for trying to help, but none of these solutions worked.
I tried "manually" setting the player team using jointeam and menuselect.
The player could not respawn at all after doing this, I also tried adding the Ham_CS_RoundRespawn.
Then a combination of the two, and both on their own.

The only ideas I have left is to just ask everyone to join a team, or just having everyone "retry".
And ofc you could set the teams with players already in a team, but it does not look very nice.
Also you could use jointeam and menuselect on all the players I guess..
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 05-13-2018 at 07:33.
GoldNux is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-13-2018 , 08:17   Re: [HELP] Moving from spec to team issue
Reply With Quote #7

After setting user team you need to also set his class by joinclass command
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
GoldNux
Senior Member
Join Date: Mar 2018
Old 05-13-2018 , 09:26   Re: [HELP] Moving from spec to team issue
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
After setting user team you need to also set his class by joinclass command
If a player joined the server and did not picked spectator they still get the HUD issue.
I tried manually picking slot5 and all kinds of things, I think I'm gonna have to give up on this one.

I also had to add delay and stuff to sort of make it work, looks really messy now..
Anyways, thanks!
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 05-13-2018 at 09:28.
GoldNux is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2018 , 11:12   Re: [HELP] Moving from spec to team issue
Reply With Quote #9

Can you provide specifics on what HUD items are glitched and features disabled?

Also a step-by-step to reproduce the issue would help.
__________________
Bugsy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-13-2018 , 11:44   Re: [HELP] Moving from spec to team issue
Reply With Quote #10

Check auto join on connect plugin
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-13-2018 at 11:45.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 19:39.


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