[Ajuda] Definir 'new' ajuda!!...
#1

Olб povo, quero uma ajuda rapidinha, й o seguinte, tenho aqui uma GZ e estou modificando, e tenho que definir um negocio aqui, e nгo sei como vou definir se й para o player .. sei lб, por isso quero ajuda pessoal olha ae:

Код:
    TerroristaEmQuebrados = 0; // Tenho que definir isso 
    MilitarEmQuebrados = 0; // Tenho que definir isso
Estou usando assim:

Код:
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            if (IsPlayerConnected(i))
            {
                if (IsPlayerInPlace(i, -1412.9468,2536.2871,-1577.1643,2727.0327))
                {
                    if (PlayerInfo[i][pMembro] == 3 || PlayerInfo[i][pLider] == 3)
                    {
                        MilitarEmQuebrados++;
                    }
                    else if (PlayerInfo[i][pMembro] == 6 || PlayerInfo[i][pLider] == 6)
                    {
                        TerroristaEmQuebrados++;
                    }
                }
            }
        }
Й pq quando o carinha entra na GZ ae fica como TerroristaEmQuebrados ou MilitarEmQuebrados, ou seja, o Terrorista entrou na zona de Guerra.

Erros:
Код:
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8980) : error 017: undefined symbol "MilitarEmQuebrados"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8980) : warning 215: expression has no effect
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8988) : error 017: undefined symbol "IsPlayerInPlace"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8992) : error 017: undefined symbol "MilitarEmQuebrados"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8992) : warning 215: expression has no effect
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8996) : error 017: undefined symbol "TerroristaEmQuebrados"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8996) : warning 215: expression has no effect
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(9001) : error 017: undefined symbol "TerroristaEmQuebrados"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(9009) : error 017: undefined symbol "TerroristaEmQuebrados"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(9016) : error 017: undefined symbol "TerroristaEmQuebrados"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(9024) : error 017: undefined symbol "TerroristaEmQuebrados"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


10 Errors.
Quero sabe se eu coloco [MAX_PLAYERS]; ou sem [MAX_PLAYERS];, ou coloco nada?
Oque devo fazer? sу isso que saber..
Reply
#2

Pelo que eu entendi, a variбvel acrescenta que mais um terrorista entrou na zona de guerra. Se for usar para ver quantos terroristas tem na zona use sem " [MAX_PLAYERS]; " e defina a variбvel como global.
Reply
#3

pawn Код:
new MilitarEmQuebrados[MAX_PLAYERS];
new TerroristaEmQuebrados[MAX_PLAYERS];
Reply
#4

Da forma que vocк estб usando tem que ser sem [MAX_PLAYERS].

Usamos [MAX_PLAYERS] quando na variбvel estб:

pawn Код:
new Fulano[MAX_PLAYERS];
Fulano[playerid];
Reply
#5

Obrigado, vou utilizar [MAX_PLAYERS] !

+rep! para os 3!
Reply
#6

Ajuda-me, acho que nгo consegui, olha ae pra mim pf:

Cods:
Код:
public IElQuebrados(playerid)
{
    TerroristaEmQuebrados = 0;
    MilitarEmQuebrados = 0;
    new string[128];
    if(ProvocoGZ2[playerid] == 1)
    {
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            if (IsPlayerConnected(i))
            {
                if (IsPlayerInPlace(i, -1412.9468,2536.2871,-1577.1643,2727.0327))
                {
                    if (PlayerInfo[i][pMembro] == 3 || PlayerInfo[i][pLider] == 3)
                    {
                        MilitarEmQuebrados++;
                    }
                    else if (PlayerInfo[i][pMembro] == 6 || PlayerInfo[i][pLider] == 6)
                    {
                        TerroristaEmQuebrados++;
                    }
                }
            }
        }
        if(TerroristaEmQuebrados != 0 && MilitarEmQuebrados != 0)
        {
            format(string,256,"[TERRITУRIO]: O combate em El Quebrados foi prolongado.");
            SendRadioMessage(3,0xFFFFFFFA,string);
            SendRadioMessage(6,0xFFFFFFFA,string);
            tempoelquebrados = SetTimerEx("IElQuebrados", 120000, 0, "i", playerid);
            return 1;
        }
        else if(TerroristaEmQuebrados == 0 && MilitarEmQuebrados != 0)
        {
            SendClientMessageToAll(COLOR_YELLOW, "[TERRITУRIO]: Forзas Armadas consegue manter o controle de El Quebrados.");
            GangZoneStopFlashForAll(gzul);
            GangZoneShowForAll(gzul,COR_EXERCITO);
            gzuldono = 0;
        }
        else if (TerroristaEmQuebrados != 0 && MilitarEmQuebrados == 0) // 5750
        {
            format(string, sizeof(string), "[TERRITУRIO]: FARC conseguiram tomar o controle de El Quebrados. ");
            SendClientMessageToAll(COLOR_YELLOW, string);
            GangZoneStopFlashForAll(gzul);
            GangZoneShowForAll(gzul,COLOR_FARC);
            gzuldono = 1;
        }
        else if(TerroristaEmQuebrados == 0 && MilitarEmQuebrados == 0) //5763
        {
            SendClientMessageToAll(COLOR_YELLOW, "[TERRITУRIO]: O territуrio em El Quebrados estб livre de Guerras!");
            GangZoneStopFlashForAll(gzul);
            GangZoneShowForAll(gzul,0xC0C0C0AA);
            gzuldono = 3;
        }
        GuerranoGZ1 = 0;
        KillTimer(tempoelquebrados);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            Dominando[i] = 0;
            ProvocoGZ2[i] = 0;
        }
    }
    return 1;
}
Tб dando erro sу nas linha que mandei ae.

Erros:
Код:
C:\Documents and Settings\P.Henrique\Desktop\samp03\pawno\include\ppg.inc(15) : warning 203: symbol is never used: "unused_var"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8982) : error 033: array must be indexed (variable "TerroristaEmQuebrados")
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8983) : error 033: array must be indexed (variable "MilitarEmQuebrados")
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8991) : error 017: undefined symbol "IsPlayerInPlace"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8995) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8995) : warning 215: expression has no effect
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8999) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8999) : warning 215: expression has no effect
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(9004) : error 033: array must be indexed (variable "TerroristaEmQuebrados")
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(9012) : error 033: array must be indexed (variable "TerroristaEmQuebrados")
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(9019) : error 033: array must be indexed (variable "TerroristaEmQuebrados")
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(9027) : error 033: array must be indexed (variable "TerroristaEmQuebrados")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


9 Errors.
afs, arrumei uma coisa e bugei outra, afs ;( alguem?
Reply
#7

pawn Код:
public IElQuebrados(playerid)
{
    new string[128];
    if(ProvocoGZ2[playerid] == 1)
    {
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            if (IsPlayerConnected(i))
            {
                if (IsPlayerInPlace(i, -1412.9468,2536.2871,-1577.1643,2727.0327))
                {
                    if (PlayerInfo[i][pMembro] == 3 || PlayerInfo[i][pLider] == 3)
                    {
                        MilitarEmQuebrados[i]++;
                    }
                    else if (PlayerInfo[i][pMembro] == 6 || PlayerInfo[i][pLider] == 6)
                    {
                        TerroristaEmQuebrados[i]++;
                    }
                }
            }
        }
        if(TerroristaEmQuebrados[i] != 0 && MilitarEmQuebrados[i] != 0)
        {
            format(string,256,"[TERRITУRIO]: O combate em El Quebrados foi prolongado.");
            SendRadioMessage(3,0xFFFFFFFA,string);
            SendRadioMessage(6,0xFFFFFFFA,string);
            tempoelquebrados = SetTimerEx("IElQuebrados", 120000, 0, "i", playerid);
            return 1;
        }
        else if(TerroristaEmQuebrados[i] == 0 && MilitarEmQuebrados[i] != 0)
        {
            SendClientMessageToAll(COLOR_YELLOW, "[TERRITУRIO]: Forзas Armadas consegue manter o controle de El Quebrados.");
            GangZoneStopFlashForAll(gzul);
            GangZoneShowForAll(gzul,COR_EXERCITO);
            gzuldono = 0;
        }
        else if (TerroristaEmQuebrados[i] != 0 && MilitarEmQuebrados[i] == 0) // 5750
        {
            format(string, sizeof(string), "[TERRITУRIO]: FARC conseguiram tomar o controle de El Quebrados. ");
            SendClientMessageToAll(COLOR_YELLOW, string);
            GangZoneStopFlashForAll(gzul);
            GangZoneShowForAll(gzul,COLOR_FARC);
            gzuldono = 1;
        }
        else if(TerroristaEmQuebrados[i] == 0 && MilitarEmQuebrados[i] == 0) //5763
        {
            SendClientMessageToAll(COLOR_YELLOW, "[TERRITУRIO]: O territуrio em El Quebrados estб livre de Guerras!");
            GangZoneStopFlashForAll(gzul);
            GangZoneShowForAll(gzul,0xC0C0C0AA);
            gzuldono = 3;
        }
        GuerranoGZ1 = 0;
        KillTimer(tempoelquebrados);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            Dominando[i] = 0;
            ProvocoGZ2[i] = 0;
        }
    }
    return 1;
}
Reply
#8

Vou copilar aqui jб te dou noticias amigo.
Reply
#9

Код:
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(5894) : error 017: undefined symbol "pexp"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8986) : error 017: undefined symbol "IsPlayerInPlace"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(8999) : error 017: undefined symbol "i"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(9007) : error 017: undefined symbol "i"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(9014) : error 017: undefined symbol "i"
C:\Documents and Settings\P.Henrique\Desktop\samp03\gamemodes\BUL.pwn(9022) : error 017: undefined symbol "i"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Me ajudou um pouquinho tirou uns erros, estou tentando tirar pera ae.
Reply
#10

Nгo consegui, afs, й agora?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)