[Ajuda] base
#1

bom eu estou querendo criar um sistema assim:

no meu gm tem 2 times ct e tr, eu queria fazer um sistema que a cada 2 minutos iniciase uma base, e cada base durar 8 minutos, ai eu queria que tipo o ct nasce em um local e o tr no outro, e quando um players entra no server se ja tiver base aberta ele va direto para base.
e queria que desse para spawnar so 15 jogadores em cada time..

meu amigo fez uma base mais da mts erros quando ponho no gm..

pawn Код:
#include <a_samp>
#include <zcmd>
#define CT (0)
#define TR (1)
new Time[MAX_PLAYERS];
new basedavez;
new Float:SpawnBaseOne[][3]={
    {-1318.6720,438.0658,7.1875},//ct
    {-1318.6720,438.0658,7.1875}//tr
};
new Float:SpawnBaseTwo[][3]={
    {-1318.6720,438.0658,7.1875},//ct
    {-1318.6720,438.0658,7.1875}//tr
};
main(){}
public OnGameModeInit()
{
    SetTimer("NovaBase",10*60000,true);
    basedavez = random(1);
    AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
    AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
    return 1;
}
public OnPlayerSpawn(playerid)
{
    if(basedavez == 0)
    {
        if(Time[playerid]==CT)
        {
            SetPlayerPos(playerid,SpawnBaseOne[0][0],SpawnBaseOne[0][1],SpawnBaseOne[0][2]);
        }else if(Time[playerid]==TR)
        {
            SetPlayerPos(playerid,SpawnBaseOne[1][0],SpawnBaseOne[1][1],SpawnBaseOne[1][2]);
        }
    }else if(basedavez == 1)
    {
        if(Time[playerid]==CT)
        {
            SetPlayerPos(playerid,SpawnBaseTwo[0][0],SpawnBaseTwo[0][1],SpawnBaseTwo[0][2]);
        }else if(Time[playerid]==TR)
        {
            SetPlayerPos(playerid,SpawnBaseTwo[1][0],SpawnBaseTwo[1][1],SpawnBaseTwo[1][2]);
        }
    }
    return 1;
}
forward NovaBase();
public NovaBase()
{
    basedavez = random(1);
    SetTimer("EncerrarPartida",10*60001,false);
    return 1;
}
forward EncerrarPartida();
public EncerrarPartida()
{
    for(new i; i != MAX_PLAYERS; ++i)
    {
        if(IsPlayerConnected(i))
        {
            SpawnPlayer(i);
        }
    }
    return 1;
}
CMD:souct(playerid)
{
    Time[playerid]=CT;
    return 1;
}
CMD:soutr(playerid)
{
    Time[playerid]=TR;
    return 1;
}
Reply
#2

Tenta isto
pawn Код:
#include <a_samp>
#include <zcmd>


#define TEAM_CT         (0)
#define TEAM_TR         (1)


new
    Float:SpawnBaseOne[][3]=
    {
        {-1318.6720,438.0658,7.1875},//ct
        {-1318.6720,438.0658,7.1875}//tr
    },
   
    Float:SpawnBaseTwo[][3]={
        {-1318.6720,438.0658,7.1875},//ct
        {-1318.6720,438.0658,7.1875}//tr
    },
    TeamPlayers[2],
    BaseID
;


public OnGameModeInit()
{
    SetTimer("NovaBase", 60000 * 8,true);
   
    AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
    AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
   
    BaseID = sizeof(SpawnBaseTwo);
    return 1;
}


forward NovaBase(); public NovaBase(){


    static
        getPlayers
    ;
   
    getPlayers = GetMaxPlayers();
   
    for( ; getPlayers > -1; --getPlayers){
        if(BaseID == 0){
            sPawnPlayer(getPlayers);
            switch(GetPlayerTeam(getPlayers)){
                case TEAM_CT: SetPlayerPos(getPlayers, SpawnBaseOne[0][0], SpawnBaseOne[0][1], SpawnBaseOne[0][2]),  TeamPlayers[TEAM_CT] ++;
                case TEAM_TR: SetPlayerPos(getPlayers, SpawnBaseOne[1][0], SpawnBaseOne[1][1], SpawnBaseOne[1][2]), TeamPlayers[TEAM_TR] ++ ;
            }
        }

        if(BaseID == 1){
            sPawnPlayer(getPlayers);
            switch(GetPlayerTeam(getPlayers))
            {
                case TEAM_CT: SetPlayerPos(getPlayers, SpawnBaseTwo[0][0], SpawnBaseTwo[0][1], SpawnBaseTwo[0][2]),  TeamPlayers[TEAM_CT] ++;
                case TEAM_TR: SetPlayerPos(getPlayers, SpawnBaseTwo[1][0], SpawnBaseTwo[1][1], SpawnBaseTwo[1][2]),  TeamPlayers[TEAM_TR] ++;
            }
        }
    }
    return (sizeof(SpawnBaseTwo) >= BaseID) ? (BaseID = 0) : (BaseID++);
}


public OnPlayerSpawn(playerid)
    PawnPlayer(playerid);
    switch(GetPlayerTeam(getPlayers))
    {
        case TEAM_CT: SetPlayerPos(getPlayers, SpawnBaseTwo[0][0], SpawnBaseTwo[0][1], SpawnBaseTwo[0][2]),  TeamPlayers[TEAM_CT] ++;
        case TEAM_TR: SetPlayerPos(getPlayers, SpawnBaseTwo[1][0], SpawnBaseTwo[1][1], SpawnBaseTwo[1][2]),  TeamPlayers[TEAM_TR] ++;
    }
    return true;
}
   
stock sPawnPlayer(p){
    if(TeamPlayers[TEAM_CT] <= TeamPlayers[TEAM_TR]){
        SetPlayerTeam(p, TEAM_CT);
    }
    else if(TeamPlayers[TEAM_CT] >= TeamPlayers[TEAM_CT]){
        SetPlayerTeam(p, TEAM_TR);
    }
    return true;
}


CMD:souct(playerid)
{
    SetPlayerTeam(playerid, TEAM_CT);
    return 1;
}
CMD:soutr(playerid)
{
    SetPlayerTeam(playerid, TEAM_TR);
    return 1;
}
Reply
#3

Ei garfield eu consegui tirar os erros, mais estou precinsando de outra ajuda do mesmo caso..
Add meu msn ai por favor. lucash.8@hotmail.com

Valeu por da atenзгo ao topico.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)