Ajuda territorio
#1

Bom comeзei a faser meu 1 territorio no meu gm RPG peguei cordenadas tudo certim vi tutoriais da ki deu certo quase tudo so falto a parte que avisa que tal org domino o territorio ele fica piscando pelo resto da vida e nao avisa que dominaram ja tentei add no meu gm isso ae em baixo tudo mas nao da certo :S

new GZFloresta;
new donoFloresta;
new ProvocoFloresta[MAX_PLAYERS];
new TempoGuerraFloresta;
forward Floresta(playerid);
new GuerranaFloresta;

GangZoneShowForPlayer(playerid, GZFloresta, 0xC0C0C0AA);

}
if(ProvocoFloresta[playerid] == 1)
{
GangZoneStopFlashForAll(GZFloresta);
GangZoneShowForAll(GZFloresta, 0xFFFFFF96);
GuerranaFloresta = 0;
ProvocoFloresta[playerid] = 0;
donoFloresta = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraFloresta);
}

essa parte aki funciona tudo certo
}
if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6)//Taliban1
{
if(IsPlayerInFloresta(playerid))
{
if(Dominando[playerid] == 1)
{
MSGPLAYER(playerid, COLOR_GRAD5, "Vocк ja estб dominando um territorio.");
return 1;
}
if(GuerranaFloresta == 1)
{
MSGPLAYER(playerid, COLOR_GRAD5, "Jб estб tendo uma guerra nesse territorio.");
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e a Taliban Estao Dominando a Floresta!",playername);
MSGPARATODOS(COR_TAL, string);
MSGPLAYER(playerid, COLOR_GRAD3, "Fique esperto, o Exercito ea Alqaeda foram avisado!");
MSGPLAYER(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar estб area .");
GangZoneFlashForAll(GZFloresta,COR_TAL);
Dominando[playerid] = 1;
ProvocoFloresta[playerid] = 1;
GuerranaFloresta = 1;
TempoGuerraFloresta = SetTimerEx("GuerraFloresta", 60000, 0, "i", playerid);
return 1;
}
else
{
MSGPLAYER(playerid, COLOR_GRAD3, "Vocк nгo estб em nenhum territуrio!");
}
return 1;
}

essa aki errada nao apareзe que dominaram:2
}
if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6)
{
if(ProvocoEstacao[playerid] == 1)
{
if(IsPlayerInEstacao(playerid))
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e a Taliban Dominaram a Floresta!",playername);
MSGPARATODOS(COR_TAL, string);
MSGPLAYER(playerid, COLOR_GRAD5, "Vocк dominou a Floresta, a cada 5 minutos nela ganharб grana.");
GangZoneStopFlashForAll(GZFloresta);
GangZoneShowForAll(GZFloresta,COR_TAL);
Dominando[playerid] = 0;
ProvocoFloresta[playerid] = 0;
GuerranaFloresta = 0;
donoFloresta = 1;
KillTimer(TempoGuerraFloresta);
return 1;
}
else
{
MSGPLAYER(playerid, COR_TAL, "Vocк nгo estб na Floresta.");
Dominando[playerid] = 0;
GangZoneStopFlashForAll(GZFloresta);
GangZoneShowForAll(GZFloresta, 0xFFFFFF96);
ProvocoFloresta[playerid] = 0;
GuerranaFloresta = 0;
donoFloresta = 0;
KillTimer(TempoGuerraFloresta);
return 1;
}
}
return 1;
}

E ISSO AE SO NAO FUNCIONA A PARTE DE BAIXO 2 A 1 FUNCIONO CERTIM E ISSO AE ESPERO QUE ME AJUDEM
Reply
#2

Vocк criou a callback, ou seja, public e forward GuerraFloresta(playerid) ?

O problema estб nela, provavelmente vocк esqueceu de criб-la ou definir algo nela, como algo que checa se a equipe й a do jogador que estб usando o comando, etc .

Se vocк tiver criado sу a forward, coloque no final do seu GM:

pawn Код:
public GuerraFloresta(playerid)
{
    if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6)
    {
        if(ProvocoEstacao[playerid] == 1)
        {
            if(IsPlayerInEstacao(playerid))
            {
                GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
                format(string, sizeof(string), "%s e a Taliban Dominaram a Floresta!",playername);
                MSGPARATODOS(COR_TAL, string);
                MSGPLAYER(playerid, COLOR_GRAD5, "Vocк dominou a Floresta, a cada 5 minutos nela ganharб grana.");
                GangZoneStopFlashForAll(GZFloresta);
                GangZoneShowForAll(GZFloresta,COR_TAL);
                Dominando[playerid] = 0;
                ProvocoFloresta[playerid] = 0;
                GuerranaFloresta = 0;
                donoFloresta = 1;
                KillTimer(TempoGuerraFloresta);
            }
            else
            {
                MSGPLAYER(playerid, COR_TAL, "Vocк nгo estб na Floresta.");
                Dominando[playerid] = 0;
                GangZoneStopFlashForAll(GZFloresta);
                GangZoneShowForAll(GZFloresta, 0xFFFFFF96);
                ProvocoFloresta[playerid] = 0;
                GuerranaFloresta = 0;
                donoFloresta = 0;
                KillTimer(TempoGuerraFloresta);
                return 1;
            }
        }
    }
    return 1;
}

Se nгo tiver criado a forward, coloque no final do seu GM:


pawn Код:
forward GuerraFloresta(playerid);
public GuerraFloresta(playerid)
{
    if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6)
    {
        if(ProvocoEstacao[playerid] == 1)
        {
            if(IsPlayerInEstacao(playerid))
            {
                GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
                format(string, sizeof(string), "%s e a Taliban Dominaram a Floresta!",playername);
                MSGPARATODOS(COR_TAL, string);
                MSGPLAYER(playerid, COLOR_GRAD5, "Vocк dominou a Floresta, a cada 5 minutos nela ganharб grana.");
                GangZoneStopFlashForAll(GZFloresta);
                GangZoneShowForAll(GZFloresta,COR_TAL);
                Dominando[playerid] = 0;
                ProvocoFloresta[playerid] = 0;
                GuerranaFloresta = 0;
                donoFloresta = 1;
                KillTimer(TempoGuerraFloresta);
            }
            else
            {
                MSGPLAYER(playerid, COR_TAL, "Vocк nгo estб na Floresta.");
                Dominando[playerid] = 0;
                GangZoneStopFlashForAll(GZFloresta);
                GangZoneShowForAll(GZFloresta, 0xFFFFFF96);
                ProvocoFloresta[playerid] = 0;
                GuerranaFloresta = 0;
                donoFloresta = 0;
                KillTimer(TempoGuerraFloresta);
                return 1;
            }
        }
    }
    return 1;
}

E se jб tiver criado tudo, basta checar se й de tal equipe, entre outros, tudo isso dentro da callback .


Espero ter ajudado .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)