SA-MP Forums Archive
[Ajuda] /Contagem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] /Contagem (/showthread.php?tid=333108)



[Ajuda] /Contagem - [NVC]Eduardo - 10.04.2012

Erros:
pawn Code:
Bernardo\Desktop\Server\samp\gamemodes\GM.pwn(10916) : error 047: array sizes do not match, or destination array is too small
C:\Users\Bernardo\Desktop\Server\samp\gamemodes\GM.pwn(10924) : warning 219: local variable "contagem" shadows a variable at a preceding level
C:\Users\Bernardo\Desktop\Server\samp\gamemodes\GM.pwn(10926) : error 006: must be assigned to an array
C:\Users\Bernardo\Desktop\Server\samp\gamemodes\GM.pwn(10927) : error 028: invalid subscript (not an array or too many subscripts): "contagem"
C:\Users\Bernardo\Desktop\Server\samp\gamemodes\GM.pwn(10927) : warning 215: expression has no effect
C:\Users\Bernardo\Desktop\Server\samp\gamemodes\GM.pwn(10927) : error 001: expected token: ";", but found "]"
C:\Users\Bernardo\Desktop\Server\samp\gamemodes\GM.pwn(10927) : error 029: invalid expression, assumed zero
C:\Users\Bernardo\Desktop\Server\samp\gamemodes\GM.pwn(10927) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
Code:
pawn Code:
if(strcmp("/contagem", cmdtext, true, 10) == 0)
{
    new tmp[128];
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(pAdmin[playerid] == 5) {

        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) {
            SendClientMessage(playerid, Vermelho, "Uso: /contagem [quantia]");
            return 1;
        }
        new contando = strval(tmp);
        new Float:contagemx,Float:contagemy,Float:contagemz; // BRAHMA *-*
        GetPlayerPos(playerid, contagemx, contagemy, contagemz);
        for(new contagem; contagem < MAX_PLAYERS; contagem++) {
        if(IsPlayerInRangeOfPoint(contagem, 10.0, contagemx, contagemy, contagemz)) {
                contar[playerid] = contar;
                contagem[playerid] = SetTimerEx("Contagem", 1000, true, "i", i);
            }
        }
    }
    else {
        SendClientMessage(playerid, Vermelho, "I ERRO I Vocк nгo tem acesso a esse comando!");
    }
    return 1;
}
+ rep


Re: [Ajuda] /Contagem - kinhobryant - 10.04.2012

mal indentado.


Re: [Ajuda] /Contagem - GReeN_WOoD - 10.04.2012

PHP Code:
new string[56];
new 
tempoTempoContando;
forward Contando();
CMD:contagem(playeridparams[])
{
    if(
sscanf(params"i"time)) return SendClientMessage(playerid,-1,"Use: /contagem [segundos]");
    if((
tempo 1) || (tempo 60)) return SendClientMessage(playeridCINZA"Mбximo de segundos: 60");
    
format(stringsizeof(string), "Contagem de %d segundos iniciada."tempo);
    
SendClientMessageToAll(-1string);
    
TempoContandoSetTimer("Contando"1000true);
    return 
true;
}
public 
Contando()
{
    if(
tempo == 0)
    {
        
KillTimer(TempoContando);
           
SendClientMessage(playerid,-1,"A contagem terminou.");
        
GameTextForAll("~r~contagem terminada"10006);
        return 
true;
    }
    
format(stringsizeof(string), "~g~%d"tempo);
    
GameTextForAll(string10006);
    
tempo--;
    return 
true;