SA-MP Forums Archive
Event system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Event system (/showthread.php?tid=613480)



Event system - Loinal - 28.07.2016

First hello guys, i made my event system and all maps is dm i don't know how i make TDM because its /event and it with textdraw countdown so i don't know how i make Team Balancer, Any help please.


Re: Event system - F1N4L - 28.07.2016

Код:
#define TEAM_A 0
#define TEAM_B 1

new CountT_A, CountT_B;

if(CountT_A < 1 || CountT_A < CountT_B)
{
	SetPlayerTeam(playerid, TEAM_A);
	++ CountT_A;
}
else if(CountT_B < 1 || CountT_B < CountT_A)
{
	SetPlayerTeam(playerid, TEAM_B);
	++ CountT_B;
}



Re: Event system - Loinal - 28.07.2016

Any example code with /event pls


Re: Event system - F1N4L - 28.07.2016

Код:
CMD:event(playerid)
{
	if(CountT_A < 1 || CountT_A < CountT_B)
	{
		SetPlayerTeam(playerid, TEAM_A);
		++ CountT_A;
		
		SendClientMessage(playerid, -1, "You're in team A");
		
		SetPlayerPos(playerid, x, y, z); // pos of team a
	}
	else if(CountT_B < 1 || CountT_B < CountT_A)
	{
		SetPlayerTeam(playerid, TEAM_B);
		++ CountT_B;
		
		SendClientMessage(playerid, -1, "You're in team B");
		
		SetPlayerPos(playerid, x, y, z); // pos of team b
	}
	return true;
}



Re: Event system - Loinal - 28.07.2016

Thanks very much