Change team silently

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Change team silently

Postby BackRaw » Tue Nov 10, 2015 10:08 pm

Hi,

since SP has been updated multiple times now, I'd like to ask: does there is the feature of changing a player's team silently, without them dying, already exist?

Thanks in advance :D
My Github repositories:

Source.Python: https://github.com/backraw
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Tue Nov 10, 2015 10:18 pm

That feature already exists since a long time. :tongue:

Syntax: Select all

<Player object>.switch_team(<team number>)
This will move the player to the given team without killing him (currently available on CS:S and CS:GO). But it will send a chat message that the player changed the team. If you want to block that message as well, you might want to try to hook the player_team event and return EventAction.DONT_BROADCAST. If I remember correctly this will block the message. If not, please let me know. :)
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Postby BackRaw » Wed Nov 11, 2015 9:05 pm

Alright awesome! I'll give it a try

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 160 guests