Loosing a Variable
#4

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.

Код:
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
	}
}
Keep in mind that it's ages since I've coded in PAWN, it's mostly Java nowadays..
Reply


Messages In This Thread
Loosing a Variable - by Rodri99 - 25.08.2015, 16:53
Re: Loosing a Variable - by SpikY_ - 25.08.2015, 17:01
Re: Loosing a Variable - by Rodri99 - 25.08.2015, 17:04
Re: Loosing a Variable - by SKAzini - 25.08.2015, 17:06
Re: Loosing a Variable - by Tamer - 25.08.2015, 17:06
Re: Loosing a Variable - by SKAzini - 25.08.2015, 17:12
Re: Loosing a Variable - by Tamer - 25.08.2015, 17:15
Re: Loosing a Variable - by Rodri99 - 25.08.2015, 17:21

Forum Jump:


Users browsing this thread: 1 Guest(s)