Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script.PickBan.Complete Callback when you want to have a Pick and Ban through pyplanet #1329

Open
w1lla opened this issue Apr 30, 2024 · 0 comments

Comments

@w1lla
Copy link
Contributor

w1lla commented Apr 30, 2024

Hi, in TM2020 a new callback is introduced for using pick and Ban
Callback return:
pickban_complete = Callback(
call='Script.PickBan.Complete',
namespace='trackmania',
code='pickban_complete',
target=handle_generic
)

Code to set it up:
Works only in Team GameModes:

		pickbandata = '{"steps":[{"team":1,"action":"ban"},{"team":1,"action":"pick"},{"team":2,"action":"pick"},{"team":3,"action":"pick"},{"team":4,"action":"pick"},{"team":5,"action":"pick"}],"stepDuration":60000,"resultDuration":10000}'
		
		await self.instance.gbx.script('PickBan.Start', pickbandata, encode_json=False, response_id=False),
		await self.instance.chat('$ff0Admin $fff{}$z$s$ff0 tried to do a pickban with following data: {}.'.format(
				player.nickname,pickbandata)
		)```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant