25.08.2015, 17:06
Essentially you need a player variable "inevent" which defines if the player is in the event or not. You need to set this variable when you add the player to the minigame, and unset it when they're out.
Then you just simply check how many are in the game, and perform actions based on that information.
Keep in mind that it's ages since I've coded in PAWN, it's mostly Java nowadays..
Then you just simply check how many are in the game, and perform actions based on that information.
Код:
timer.. { new amount = 0; new lastpid = -1; foreach.. { if (inevent[player]) { amount++; lastpid = player; } } if (amount <= 1) { if (amount == 1) { // give lastpid the rewards } // reset the game } }