How to get half and half of players?
#1

Like if there are 5 persons in the server

put 3 in pos x,y,z

and put the other 2 in the pos x,y,z
Reply
#2

What? Explain more, I don't understand your post.
Reply
#3

Like it'll say New Fight!
and it'll set half of the players of the server on certain position
and the other half of players in the other certain position.
Reply
#4

Oh, like getting each team..... contact me via pm and tell me what are your teams.. :P
Reply
#5

Try foreach

pawn Код:
Iter_Count(Player) //For the amount of players
Divide the count by 2, round up. Then do a foreach loop (only players).

Should be fairly easy to guess what comes next
Reply
#6

Like my LastManStanding event script? You can use that one and edit it with teams.
Reply
#7

pawn Код:
CMD:getblue(playerid, params[])
{
    new Float:x, Float:y, Float:z;
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    if(gTeam[i] == TEAM_BLUE)
    {
        GetPlayerPos(playerid, x ,y ,z);
        SetPlayerPos(i, x, y, z);
    }
    }
}

CMD:getred(playerid, params[])
{
    new Float:x, Float:y, Float:z;
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    if(gTeam[i] == TEAM_GREEN)
    {
        GetPlayerPos(playerid, x ,y ,z);
        SetPlayerPos(i, x, y, z);
    }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)