SA-MP Forums Archive
How to - 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: How to (/showthread.php?tid=632683)



How to - Kraeror - 17.04.2017

How can i check how many of people are from some team? And make if(playersfromgang[grove] == 5) return ....?
Can you make stock for me ?


Re: How to - Kraeror - 17.04.2017

WTF... Any ideas ?


Re: How to - JustNothing - 17.04.2017

Код HTML:
GetTeamMembers(teamid){

	new tmemb;
	for(new t; t < MAX_PLAYERS; t++) if(IsPlayerConnected(t) && /*playerinfo[t][team]*/ == teamid) tmemb ++;
	return tmemb;
}
example:
Код HTML:
if(GetTeamMembers(1) == 5){

	// code
}



Re: How to - Kraeror - 17.04.2017

Quote:
Originally Posted by JustNothing
Посмотреть сообщение
Код HTML:
GetTeamMembers(teamid){

	new tmemb = 0;
	for(new t; t < MAX_PLAYERS; t++) if(IsPlayerConnected(t) && /*playerinfo[t][team]*/ == teamid) return tmemb ++;
	return tmemb;
}
example:
Код HTML:
if(GetTeamMembers(teamid) == 5){

	// code
}
Thanks a lot!!!!!!!!!!!!!!!!!