Auto team balanze en comando
#1

bueno pues quiero que cuando el usuario use /enter se seleccione el equipo del jugador automбticamente,

vi unos ejemplos como este:

EDIT______________________________________________ __________________________________________________

encontrй este:
pawn Код:
#include<a_samp>

#define TEAM_ONE 0
#define TEAM_TWO 1

static gTeam[MAX_PLAYERS];

stock GetPlayersInTeamFromMaxPlayers(teamid)
{
    new playercount = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerState(i) == PLAYER_STATE_NONE) continue;
        if(gTeam[i] != teamid) continue;
        playercount++;
    }
    return playercount;
   
    public OnPlayerRequestSpawn(playerid)
{
    new team1 = GetPlayersInTeamFromMaxPlayers(TEAM_ONE);
    new team2 = GetPlayersInTeamFromMaxPlayers(TEAM_TWO);
    if(team1 > team2 && gTeam[playerid] == TEAM_ONE)
    {
        GameTextForPlayer(playerid, "~r~Team Full!~n~~w~Choose Another Team!", 3000, 5);
        return 0;
    }
    else if(team2 > team1 && gTeam[playerid] == TEAM_TWO)is trying to spawn as TEAM_TWO..
    {
        GameTextForPlayer(playerid, "~r~Team Full!~n~~w~Choose Another Team!", 3000, 5);
        return 0;
    }
    return 1;
}
el problema de este es que al poner
pawn Код:
static gTeam[MAX_PLAYERS];
me da todos estos errores:
Quote:

C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(30) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(35) : warning 225: unreachable code
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(35) : warning 217: loose indentation
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(35) : error 029: invalid expression, assumed zero
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(35) : error 004: function "OnGameModeInit" is not implemented
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(43) : warning 225: unreachable code
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(43) : error 029: invalid expression, assumed zero
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(43) : error 004: function "OnPlayerConnect" is not implemented
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(45) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(49) : warning 225: unreachable code
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(49) : error 029: invalid expression, assumed zero
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(49) : error 004: function "OnPlayerDeath" is not implemented
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(52) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(54) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(55) : error 017: undefined symbol "killerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(56) : error 017: undefined symbol "killerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(57) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(62) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(70) : warning 225: unreachable code
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(70) : error 029: invalid expression, assumed zero
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(70) : error 004: function "OnPlayerCommandText" is not implemented
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(72) : error 017: undefined symbol "cmdtext"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(79) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(87) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(93) : error 017: undefined symbol "cmdtext"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(100) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(103) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(107) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(113) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(119) : error 017: undefined symbol "cmdtext"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(123) : error 017: undefined symbol "playerid"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.

sin el me salen estos:
Quote:

C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(29) : error 017: undefined symbol "gTeam"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(29) : error 017: undefined symbol "playerid"
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(29) : error 029: invalid expression, assumed zero
C:\Users\Porta0123\Desktop\PAWN\filterscripts\OSEv ent.pwn(29) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

la lнnia de los 4 errores es:
pawn Код:
stock GetPlayersInTeamFromMaxPlayers(teamid)
{
    new playercount = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerState(i) == PLAYER_STATE_NONE) continue;
        if(gTeam[playerid] != teamid) continue; //AQUI
        playercount++;
    }
    return playercount;
Reply


Messages In This Thread
Auto team balanze en comando - by Porta0123 - 03.02.2014, 19:38
Respuesta: Auto team balanze en comando - by OTACON - 03.02.2014, 20:04
Respuesta: Auto team balanze en comando - by Porta0123 - 03.02.2014, 20:13
Respuesta: Auto team balanze en comando - by Porta0123 - 04.02.2014, 18:15
Respuesta: Auto team balanze en comando - by Swedky - 04.02.2014, 18:31
Respuesta: Auto team balanze en comando - by Porta0123 - 04.02.2014, 18:56
Re: Auto team balanze en comando - by spell - 05.02.2014, 03:44
Respuesta: Auto team balanze en comando - by Porta0123 - 05.02.2014, 16:44

Forum Jump:


Users browsing this thread: 2 Guest(s)