team balancer(when pressed F4)
#1

Onplayerdeath
pawn Код:
if(GetPlayerTeam(playerid) == 1) team1[playerid] = 1;
    if(GetPlayerTeam(playerid) == 2) team2[playerid] = 1;
OnPlayerRequestSpawn
pawn Код:
if(class1[playerid] == 1)
    {
        if(tcount > acount)
        {
            SendClientMessage(playerid, -1, "Team is "COL_VIOLET"full"COL_WHITE"!");
            return 0;
        }
        else
        {
            tcount++;
            if(team2[playerid] == 1) acount--;
            return 1;
        }
    }
   
    if(class2[playerid] == 1)
    {
        if(acount > tcount)
        {
            SendClientMessage(playerid, -1, "Team is "COL_VIOLET"full"COL_WHITE"!");
            return 0;
        }
        else
        {
            acount++;
            if(team1[playerid] == 1) tcount--;
            return 1;
        }
    }
I've created a command called /teams if I can record the error.
If I join terrorists, terrorists will be 1. If I join police, terrorists will be 1, and police will also be 1.
it doesn't subtract
Reply
#2

So what you trying todo is make it so when you type /teams it will loop through all the players on all the times and display how many players are on each team?
Reply
#3

No.
Quote:

If I join terrorists, terrorists will be 1. If I join police, terrorists will be 1, and police will also be 1.

My point is, there is already a subtract that when you are from another team, it will be subtracted, but it doesn't get subtracted at all!
Reply
#4

Don't subtract at all. You don't have to and it will cause problems.

Let's say you join team A and it goes 1 players. I join team B and it goes 1 players too but your team A goes 0 with the subtraction.
Reply
#5

Can you give me some example from my script? I really do not get what I am scripting right now. THe only problem in my server is this fucking Team Balancer, I am fucking brainwashed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)