03.05.2014, 12:15
(
Последний раз редактировалось TheSimpleGuy; 04.05.2014 в 11:36.
)
I've developed my own team balancer but my friends can join the same team as mine.
pawn Код:
new tcount, acount;
//NOTE: Sorted script
//onplayerrequestspawn
if(class2[playerid] == 2 && GetPlayerTeam(playerid) == 2) {
tcount--;
acount++;
return 1; }
if(class1[playerid] == 1 && GetPlayerTeam(playerid) == 1) { //The GetPlayerTeam is when you press F4 and select a new class
acount--;
tcount++;
return 1; }
if(class1[playerid] == 1) {
tcount++;
return 1; }
// new code
if(class1[playerid] == 1 || class2[playerid] == 1) {
if(acount > tcount)
{
SendClientMessage(playerid, -1, "Team is "COL_VIOLET"full"COL_WHITE".");
return 0;
}
else
{
SendClientMessage(playerid, -1, "Team is "COL_VIOLET"full"COL_WHITE".");
return 0;
} }
if(class2[playerid] == 1) {
acount++;
return 1; }
//OnPlayerRequestClass
if(classid == 0) {
GameTextForPlayer(playerid, "~r~Terrorist", 9999999, 6);
class1[playerid] = 1;
class2[playerid] = 0;
class3[playerid] = 0;
class4[playerid] = 0; }
if(classid == 1) {
GameTextForPlayer(playerid, "~b~Police", 9999999, 6);
class1[playerid] = 0;
class2[playerid] = 1;
class3[playerid] = 0;
class4[playerid] = 0; }
SetPlayerTeamFromClass(playerid, classid);
SetPlayerPos(playerid, 259.9881,2904.1746,7.2830);
SetPlayerFacingAngle(playerid, 0.2501);
SetPlayerCameraPos(playerid, 260.2059,2910.6101,6.2248);
SetPlayerCameraLookAt(playerid, 259.9881,2904.1746,7.2830);