Team Balance when the MapEnd
#1

Hello Everyone I have the function EndMap

I want to add in it when the map end
Set some zombies and other humans
I want it to be combinate example if
Players online 5 Set 2 Zombie and 3 Humans
But i want the server to do it automaticly
Soo The team Human Have more Players Than Zombie

Thanks you
If you dont understand nothing please tell mee i will try to explain again it
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=224853
check this
Reply
#3

Thanks for it but
I said in EndMap Function
I dont want on player request class
Reply
#4

you can post the Fuction code
Reply
#5

I made this function along time ago once i began scripting. Its just to give you an idea, you can use it anyways (not tested).

Код:
stock fxnX()
{
	new 
		humans, zombies, total
	;
	foreach (new i : Player)
	{
		switch (gTeam[i]) 
		{
			case TEAM_HUMAN: humans++;
			case TEAM_ZOMBIE: zombies++;
		}
		total++;
	}
	if (humans < zombies)
	{
		//more zombies
		new 
			humancount = floatround((total/2), floatround_floor) + 1/*Humans will always have 1 extra player*/,
			zombiecount = total - humancount
		;
		foreach (new i : Player)
		{
			if (humancount > 0) //humans can still get a member?
			{
				gTeam[i] = TEAM_HUMAN; //set that guy
				humancount--; //decrease the var
				continue; //skip that loop to avoid continuation
			}

			if (zombiecount > 0) //zombies can count?
			{
				gTeam[i] = TEAM_ZOMBIE; //set as zombie
				zombiecount--; //count decrease
			}
		}
	}
	else SendClientMessageToAll(-1, "Teams are balanced")
	
	return 1;
}
Reply
#6

No no you didnt understand mee
Lisen... I want when I call the StartMap function
I want just to get an team balance like as said the theard up
Reply
#7

Yes, call that function under the StartMap or whatever.
Reply
#8

Not Work I tested
Reply
#9

AnyOne now ?
Reply
#10

Heyy ??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)