player.switch_team() second argument

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

player.switch_team() second argument

Postby iPlayer » Tue Nov 17, 2015 1:05 pm

Hi there again
So the first argument is the team to move a player to, the third one (boolean) is whether the message should not be printed to chat, but what does the second one stand for?
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Tue Nov 17, 2015 1:58 pm

Actually, player.switch_team() only requires one argument, which is the team number.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Tue Nov 17, 2015 2:57 pm

I think you probably got that information from an old thread. We used to use CBasePlayer::ChangeTeam, but that virtual function had its issues. We have since moved to CCSPlayer::SwitchTeam which only has one argument, the team to change to. If you want to hide the chat message when using this, you will need to use a PreEvent for player_team and return EventAction.STOP_BROADCAST.
Image
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Postby iPlayer » Tue Nov 17, 2015 3:07 pm

Thanks, guys.
Indeed, I got that info from this post.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 142 guests