[Ajuda] Gangzones
#1

Galera eu segui o tutorial do membro Link_ para fazer as gangs e as gangzones dominaveis, tava tudo certinho quando eu fiz com 14 gangs mais quando eu fui acrescentar mais 10 gangs deu o maior problema, as cores dos players nгo bate com a cor das bases e algumas gangzones nao estao dominando.
Usarei este tуpico para varias duvidas...

Link do tutorial: https://sampforum.blast.hk/showthread.php?tid=182748

«Duvidas»

-La no tutorial as cores estao definidas em um sу lugar :
pawn Код:
new gzcolor[3] =
Caso eu queira colocar assim
pawn Код:
#define Color_Gang1 0xFFFFFFFF
#define Color_Gang2 0xFFFFFFFF
Como ficaria a parte final?
pawn Код:
public ZoneCheckpointCheckerbyRangel()
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i))continue;
        if(CPS_GetPlayerCheckpoint(i) > 0 && CPS_GetPlayerCheckpoint(i) <= 2 &&
            //sгo 2 checkpoints, entгo mude se for colocar mais...
            gzcolor[CPS_GetPlayerCheckpoint(i)-1] != GetPlayerColor(i))
        {
            if(cpzone[i][CPS_GetPlayerCheckpoint(i)] < 30)
            {
                cpzone[i][CPS_GetPlayerCheckpoint(i)]++;
                new tmp[10];
                format(tmp, sizeof tmp, "~w~%2d/30", cpzone[i][CPS_GetPlayerCheckpoint(i)]);
                GameTextForPlayer(i, tmp, 1001, 4);
                GangZoneFlashForAll(CPS_GetPlayerCheckpoint(i)-1, GetPlayerColor(i));
            } else if(cpzone[i][CPS_GetPlayerCheckpoint(i)] == 30) //passou 30 segundos dentro do checkpoint
            {
                GameTextForPlayer(i, "~w~Conquistado", 4000, 1);
                gzcolor[CPS_GetPlayerCheckpoint(i)-1] = GetPlayerColor(i);
                GangZoneStopFlashForAll(CPS_GetPlayerCheckpoint(i)-1);
                GangZoneHideForAll(CPS_GetPlayerCheckpoint(i)-1);
                GangZoneShowForAll(CPS_GetPlayerCheckpoint(i)-1, GetPlayerColor(i));//Ficar piscando a cor do player na GZ
            }
        }
    }
}
Pois se eu apagar este "gzcolor" da alguns erros nessa ultima parte:

Erros
pawn Код:
error 017: undefined symbol "gzcolor"
 warning 215: expression has no effect
 error 001: expected token: ";", but found "]"
warning 217: loose indentation
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Alguem poderia ajudar?
Reply
#2

Luciano, sobre as cores, tecnicamente vocк deveria contar as gzcolors do 0 e coloca-las em ordem com as defines das gangs.

pawn Код:
if(CPS_GetPlayerCheckpoint(i) > 0 && CPS_GetPlayerCheckpoint(i) <= 2 &&
E Aн, vocк aumenta o 2 para o numero de gangzones que vocк tem, acrescentando uma, exemplo: se vocк tem 19, vocк coloca 20 ali. e vб fazendo uma verificaзгo das funзхes para ver se estгo todas corretas.
Reply
#3

Aqui ja esta com 26, pois tenho 25 gangs.
Reply
#4

Quote:
Originally Posted by Luciano*
Посмотреть сообщение
Aqui ja esta com 26, pois tenho 25 gangs.
Ali nгo й quantidade de gangs, e sim a quantidade de CheckPoints criados.

Comeзando a contar pelo 0 como disse o .FuneraL.
Reply
#5

Ja coloquei 24,25,26 mais nada ainda, pois o problema й a parte do "gzcolor" neste codigo quero retira-lo sem ter erros.
Reply
#6

Quote:
Originally Posted by Luciano*
Посмотреть сообщение
Ja coloquei 24,25,26 mais nada ainda, pois o problema й a parte do "gzcolor" neste codigo quero retira-lo sem ter erros.
Esta aconteзendo bug com o "gzcolor"?

Se nгo para que retira-lo ?...

Se for retira-lo
Tente modificar aonde estб :
pawn Код:
gzcolor[CPS_GetPlayerCheckpoint(i)-1] = GetPlayerColor(--);
E coloque somente
pawn Код:
GetPlayerColor(---);
Reply
#7

Vou explicar de novo...

Eu estou usando este mйtodo,
pawn Код:
new gzcolor[26] =
{
0xC0C0C0AA,0x660000AA, 0x33CCFFAA,0xFF0000AA,0xFF80C0AA,0x9ACD32AA,0xFF6600AA,0x00D700AA,0x33AAFFAA,0xFFFF00AA,0xBBBB00AA,0xBBBB00AA,0x8AD9FFAA,0xFFFFB3AA,0x00EAEAAA,0x009F9FAA,0x0000F2AA,0x6A6A35AA, 0xFF8306AA,0x510051AA,0x7777FFAA,0x33CCFFAA,0x008000AA,0xA60000AA,0x00FF00AA
};
Quero trocar para
pawn Код:
#define Color_Gang 0xFFFFFFFF
#define Color_Gang2 0x000000FF
Pra isso eu terei que modificar esta parte

pawn Код:
public ZoneCheckpointCheckerbyRangel()
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i))continue;
        if(CPS_GetPlayerCheckpoint(i) > 0 && CPS_GetPlayerCheckpoint(i) <= 2 &&
            //sгo 2 checkpoints, entгo mude se for colocar mais...
            gzcolor[CPS_GetPlayerCheckpoint(i)-1] != GetPlayerColor(i))
        {
            if(cpzone[i][CPS_GetPlayerCheckpoint(i)] < 30)
            {
                cpzone[i][CPS_GetPlayerCheckpoint(i)]++;
                new tmp[10];
                format(tmp, sizeof tmp, "~w~%2d/30", cpzone[i][CPS_GetPlayerCheckpoint(i)]);
                GameTextForPlayer(i, tmp, 1001, 4);
                GangZoneFlashForAll(CPS_GetPlayerCheckpoint(i)-1, GetPlayerColor(i));
            } else if(cpzone[i][CPS_GetPlayerCheckpoint(i)] == 30) //passou 30 segundos dentro do checkpoint
            {
                GameTextForPlayer(i, "~w~Conquistado", 4000, 1);
                gzcolor[CPS_GetPlayerCheckpoint(i)-1] = GetPlayerColor(i);
                GangZoneStopFlashForAll(CPS_GetPlayerCheckpoint(i)-1);
                GangZoneHideForAll(CPS_GetPlayerCheckpoint(i)-1);
                GangZoneShowForAll(CPS_GetPlayerCheckpoint(i)-1, GetPlayerColor(i));//Ficar piscando a cor do player na GZ
            }
        }
    }
}
Pos neste cуdigo acima usa o "gzcolor" veja:
pawn Код:
gzcolor[CPS_GetPlayerCheckpoint(i)-1] = GetPlayerColor(i);
 gzcolor[CPS_GetPlayerCheckpoint(i)-1] != GetPlayerColor(i))
-E sim, meu problema neste momento й com as cores pois o player esta spawnando com a cor diferente da base dele.
Qualquer outra duvida pode falar aqui.
Reply
#8

Quote:
Originally Posted by Luciano*
Посмотреть сообщение
Vou explicar de novo...

Eu estou usando este mйtodo,
pawn Код:
new gzcolor[26] =
{
0xC0C0C0AA,0x660000AA, 0x33CCFFAA,0xFF0000AA,0xFF80C0AA,0x9ACD32AA,0xFF6600AA,0x00D700AA,0x33AAFFAA,0xFFFF00AA,0xBBBB00AA,0xBBBB00AA,0x8AD9FFAA,0xFFFFB3AA,0x00EAEAAA,0x009F9FAA,0x0000F2AA,0x6A6A35AA, 0xFF8306AA,0x510051AA,0x7777FFAA,0x33CCFFAA,0x008000AA,0xA60000AA,0x00FF00AA
};
Quero trocar para
pawn Код:
#define Color_Gang 0xFFFFFFFF
#define Color_Gang2 0x000000FF
Pra isso eu terei que modificar esta parte

pawn Код:
public ZoneCheckpointCheckerbyRangel()
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i))continue;
        if(CPS_GetPlayerCheckpoint(i) > 0 && CPS_GetPlayerCheckpoint(i) <= 2 &&
            //sгo 2 checkpoints, entгo mude se for colocar mais...
            gzcolor[CPS_GetPlayerCheckpoint(i)-1] != GetPlayerColor(i))
        {
            if(cpzone[i][CPS_GetPlayerCheckpoint(i)] < 30)
            {
                cpzone[i][CPS_GetPlayerCheckpoint(i)]++;
                new tmp[10];
                format(tmp, sizeof tmp, "~w~%2d/30", cpzone[i][CPS_GetPlayerCheckpoint(i)]);
                GameTextForPlayer(i, tmp, 1001, 4);
                GangZoneFlashForAll(CPS_GetPlayerCheckpoint(i)-1, GetPlayerColor(i));
            } else if(cpzone[i][CPS_GetPlayerCheckpoint(i)] == 30) //passou 30 segundos dentro do checkpoint
            {
                GameTextForPlayer(i, "~w~Conquistado", 4000, 1);
                gzcolor[CPS_GetPlayerCheckpoint(i)-1] = GetPlayerColor(i);
                GangZoneStopFlashForAll(CPS_GetPlayerCheckpoint(i)-1);
                GangZoneHideForAll(CPS_GetPlayerCheckpoint(i)-1);
                GangZoneShowForAll(CPS_GetPlayerCheckpoint(i)-1, GetPlayerColor(i));//Ficar piscando a cor do player na GZ
            }
        }
    }
}
Pos neste cуdigo acima usa o "gzcolor" veja:
pawn Код:
gzcolor[CPS_GetPlayerCheckpoint(i)-1] = GetPlayerColor(i);
 gzcolor[CPS_GetPlayerCheckpoint(i)-1] != GetPlayerColor(i))
-E sim, meu problema neste momento й com as cores pois o player esta spawnando com a cor diferente da base dele.
Qualquer outra duvida pode falar aqui.
Olhou oque eu postei?

Troque aonde tem esta parte que vocк posto,e deixe somente "GetPlayerColor".
Reply
#9

Deu certo cara obrigado +rep.

Qualquer outro problema postarei aqui!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)