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

Players have a stuck TPA request #5

Open
antisoma opened this issue Apr 22, 2020 · 7 comments
Open

Players have a stuck TPA request #5

antisoma opened this issue Apr 22, 2020 · 7 comments

Comments

@antisoma
Copy link

Players have a "stuck" TPA request. When they try to send another one it says there is already one pending. Is there a scoreboard/objective command that could clear this?

@JoeJoeTV
Copy link
Owner

Did the receiving person leave the server?
Normally, one can cancel a sent request by executing /trigger tpcanceland a receiving person can deny a request by executing /trigger tpdeny

@antisoma
Copy link
Author

Yes, I believe that was the problem - the receiving person left the server.

@antisoma
Copy link
Author

On trying to use /trigger tpcancel the player is notified that the person sent the request is not on the server or the request is invalid. /trigger tpa is still not possible.

@JoeJoeTV
Copy link
Owner

JoeJoeTV commented Apr 23, 2020

Yeah, this is a known problem. Because AFAIK, you can't check when a player left the game and execute a command on them, before they fully left the server and you can't target players if they are not on the server.
Currently, the tpa requests are reset, when the player joins again and the other request partner is also on the server
But I'm going to make a function you can run to reset this.
In the future I may use a different way to store this, so I can automatically reset this.

@antisoma
Copy link
Author

Thanks very much! Is there anything I could run now that would reset it? I actually tried resetting all scores for that player and then reissuing them an ID and first join permissions - but it didn't help.

@antisoma
Copy link
Author

antisoma commented Apr 24, 2020

Just to add - I've fixed this by running the following commands in console:

tag @a[tag=ptpp.plr.request] remove ptpp.plr.request
tag @a[tag=ptpp.plr.destination] remove ptpp.plr.destination

@JoeJoeTV
Copy link
Owner

JoeJoeTV commented Apr 24, 2020

Yes, sorry I didn't respond asap.
The player that sent a request has the tag ptpp.plr.request added and the scoreboard ptpp.plr.id.dest set to the id of the destination player.
The destination player has the tag ptpp.plr.destination added and the scoreboard ptpp.plr.id.rqst set to the id of the sending player.
If one or both of the players goes offline, you can manually reset the request, by removing the tags from both players and setting the scoreboard values from both players to 0.

If you don't remove the tags and reset the scores from both players, you might break the system.

Just to add - I've fixed this by running the following commands in console:

tag @a[tag=ptpp.plr.request] remove ptpp.plr.request
tag @a[tag=ptpp.plr.destination] remove ptpp.plr.destination

Please only remove the scores from the affected players, or you will break other requests.

You can force someone to cancel or deny a request, by setting their tpcancel or tpdeny scores to 1.

Commands(You can't remove tags of of players, if they aren't online, so you need to get both players online):

tag <sending player name> remove ptpp.plr.request
tag <destination player name> remove ptpp.plr.destination
scoreboard players set <sending player name> ptpp.plr.id.dest 0
scoreboard players set <destination player name> ptpp.plr.id.rqst 0

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

2 participants