SA-MP Forums Archive
Another question .... anyone can help me with a good team balancer .. ? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Another question .... anyone can help me with a good team balancer .. ? (/showthread.php?tid=125654)



Another question .... anyone can help me with a good team balancer .. ? - AlbanianGuy - 05.02.2010

I have 18 teams ... can anyone give me a team balancer ? and how to make it like ...
*BALANCER:This team is not avaliable for now , You will spawn as TEAM_LICKERS ...
CAn anyone help me ? cuz i realy need it ..



Re: Another question .... anyone can help me with a good team balancer .. ? - mansonh - 05.02.2010

Script Request Thread


Re: Another question .... anyone can help me with a good team balancer .. ? - AlbanianGuy - 06.02.2010

BUMP**


Re: Another question .... anyone can help me with a good team balancer .. ? - BlackFoX - 06.02.2010

pawn Код:
new example[MAX_PLAYERS];
new rank[MAX_PLAYERS];

enum playa_data{
rank, // Player Rank as example
example,/* Your Team Var as example */
ch_class // Player Class id
}
new player_data[MAX_PLAYERS][playa_data];


// OnGameModeInit ( Example )
AddPlayerClass(/* Your Data */); // Classid 0
AddPlayerClass(/* Your Data */); // Classid 1... and so on

// OnPlayerRequestSpawn
/* Check Classid */
if(player_data[playerid][ch_class] > 0 && player_data[playerid][ch_class] <= 2 && player_data[playerid][rank] < 2) // is Rank Less 2 not allowed...
{
    SendClientMessage(/* ya Message */);
    return 0; // Player Cant Spawn
}

// OnPlayerRequestClass

player_data[playerid][ch_class] = classid; // Check Classid if the Player want Spawn ( Look OnPlayerSpawn ^ )
dont forget this is an example so you must use your own Variables ^^



Re: Another question .... anyone can help me with a good team balancer .. ? - AlbanianGuy - 07.02.2010

i dont know how to do it ... can u help me ? pls pls .. i am new in scripting and ......... i realy need help ..


Re: Another question .... anyone can help me with a good team balancer .. ? - Onyx09 - 07.02.2010

Код:
paste this 2 on top of your script where you find the lines that start with new
new example[MAX_PLAYERS]; 
new rank[MAX_PLAYERS];

paste this under it on the enum section
enum playa_data{
rank, // Player Rank as example
example,/* Your Team Var as example */
ch_class // Player Class id
}
new player_data[MAX_PLAYERS][playa_data];

find public ongamemodeinit and paste this
// OnGameModeInit ( Example )
AddPlayerClass(/* Your Data */); // Classid 0
AddPlayerClass(/* Your Data */); // Classid 1... and so on

public onplayerrequestspawn and past this
// OnPlayerRequestSpawn
/* Check Classid */
if(player_data[playerid][ch_class] > 0 && player_data[playerid][ch_class] <= 2 && player_data[playerid][rank] < 2) // is Rank Less 2 not allowed...
{
SendClientMessage(/* ya Message */);
return 0; // Player Cant Spawn
}

public onplayerrequestclass and paste that 
// OnPlayerRequestClass

player_data[playerid][ch_class] = classid; // Check Classid if the Player want Spawn ( Look OnPlayerSpawn ^ )

use your variables thats the codes variables = Replace Some of the words by those u defined in ur script so u dont egt errors :D 

good luck