case "player.death": // called when a player dies
$deadplayer = $data['name']; // retrieves the player's username
$this->api->console->run("kick $deadplayer You have died!", "console"); // kicks player through command
$this->api->ban->kick($deadplayer, "You have died! Reconnect to a different server."); // kick player through API for good measure
$playersremaining = 0; // reset player remaining value
$onlineplayers = $this->api->player->online(); // get online players
foreach ($onlineplayers as $onlineplayer) {
$playersremaining++; // for each online player, increase count by one
}
$playersremaining = $playersremaining - 2; // -1 for default and -1 for the last player
if($playersremaining > 1) { // gramatical stuff:
$this->say("{$playersremaining} players remaining.");
}
if($playersremaining == 1) {
$this->say("One player remaining.");
}
if($playersremaining == 0) {
$this->say("No players remaining. Congratulations on your victory!");
}
break;
What are you trying to fix exactly and what is wrong? Then I can help a little
The death kick isn't working - the players are kicked when they don't die, they aren't when they do, and sometimes they're kicked for no reason, just randomly.
case "player.death": // called when a player dies
$deadplayer = $data['name']; // retrieves the player's username
$this->api->console->run("kick $deadplayer You have died!", "console"); // kicks player through command
$this->api->ban->kick($deadplayer, "You have died! Reconnect to a different server."); // kick player through API for good measure
$playersremaining = 0; // reset player remaining value
$onlineplayers = $this->api->player->online(); // get online players
foreach ($onlineplayers as $onlineplayer) {
$playersremaining++; // for each online player, increase count by one
}
$playersremaining = $playersremaining - 2; // -1 for default and -1 for the last player
if($playersremaining > 1) { // gramatical stuff:
$this->say("{$playersremaining} players remaining.");
}
if($playersremaining == 1) {
$this->say("One player remaining.");
}
if($playersremaining == 0) {
$this->say("No players remaining. Congratulations on your victory!");
}
break;
Sorry, indenting was removed through paste.
Is there A problem here?
Can you replace "kick" with "gamemode 2" and make it so that the server does not receive position packets from that player, but instead leaves player as a spectator?
Rollback Post to RevisionRollBack
I'm lost in my own mind while reality keeps moving.
Or, maybe the Api version of kick is getting overloaded because it is not getting cleared out, and it accidentally kicks someone who was kicked in a previous game?
Rollback Post to RevisionRollBack
I'm lost in my own mind while reality keeps moving.
Is there A problem here?
Can you replace "kick" with "gamemode 2" and make it so that the server does not receive position packets from that player, but instead leaves player as a spectator?
Or, maybe the Api version of kick is getting overloaded because it is not getting cleared out, and it accidentally kicks someone who was kicked in a previous game?
Meh, then they'd still be able to hit players. And it doesn't get saved, because the server is restarted. PocketMine Ban API goof maybe?
hey william, i know you have a lot of things to fix, even though you fixed so much and did such a good job on the server, especially with adding classes, but i want to make a suggestion: can you try to incorporate voting for maps in some way shape or form? and could you please add more chests? and maybe have sponsors refill the chests? and make tournaments a bit longer??? its a lot to ask and i know how busy you are and i'm happy with your server the way it is. keep in mind, these are just suggestions and you dont have to follow through with any of them. also, remember, pleasing and fufilling your needs, comes before the server. thanks for this amazing server, i love it, and i appreciate everything you've done with it.
and replaces it with this
This would be so that people could report when there is a hacker, and you will be notified in game.
(ex)//rp minecraftaddict
I've been studying.
Give me a sec to debug the other one.
700th Post!!!!
No. That's 30 out of 784 lines.
The death kick isn't working - the players are kicked when they don't die, they aren't when they do, and sometimes they're kicked for no reason, just randomly.
Follow @williamtdr
Is there A problem here?
Can you replace "kick" with "gamemode 2" and make it so that the server does not receive position packets from that player, but instead leaves player as a spectator?
Meh, then they'd still be able to hit players. And it doesn't get saved, because the server is restarted. PocketMine Ban API goof maybe?
Follow @williamtdr
And the newer version has a pvp section on the apis.
Follow @williamtdr
You can, there's no whitelist. Just sign on and play.
Follow @williamtdr
how do i fix this plz help
Nice! William, you should do a Walls server with this map
P.S. I love the classes they are nicley balanced.