[Ajuda] /procurar bugado
#1

Bom esse comadno estб bugado, pq qnd eu tento /procurar dб 2 mensagens (erro) ESSE JOGADOR NГO ESTБ CONECTADO e a comando inexistente.
se puderem me ajudar, fico grato:

Abaixo uma imagem mostrando o error:
Obs: apareceu duas vezes pq digitei duas vezes o /su


Cуdigo:

pawn Код:
if(strcmp(cmd, "/procurar", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
   
    format(file, sizeof(file), "scriptfiles/Contas/%s.ini", playerid);
    if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Recruta || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Rotam || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "pAdm01") == 1)
    {

        new tmp[256];
        tmp = strtok(cmdtext, idx);

        new plid;
        plid = strval(tmp);

        if(!strlen(tmp))
        {
            SendClientMessage(playerid, 0xFFD39BAA, "Use: /procurar [id] [motivo] ou /su [id] [motivo]");
            return 1;
        }
        if(IsPlayerConnected(plid))
        {
            new str[128];
            new giveplayer[MAX_PLAYER_NAME];
            new sendername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, sendername, sizeof(sendername));
            GetPlayerName(plid, giveplayer, sizeof(giveplayer));

            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[100];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;

            format(str, sizeof(str), "{0099FF}[x]{CCCCFF} Vocк foi colocado na lista de procurados pelo Policial %s || Motivo: %s", sendername, (result));
            SendClientMessage(plid, 0xFFD39BAA, str);
            format(str, sizeof(str), "{0099FF}[x]{CCCCFF} O Jogador %s,  colocou %s na lista de procurados pelo motivo: %s!", playerid, giveplayer, (result));
            SendClientMessageToAll(0xFFD39BAA, str);

            new antes;
            antes=dini_Int(file, "Procurado");
            dini_IntSet(file, "Procurado", antes+1);
            SetPlayerWantedLevel(plid, GetPlayerWantedLevel(plid)+1);
            Procurados[plid]++;
            return 1;
        }
        else
        {
            SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Jogador nгo conectado no momento!");
        }
    }
    else
    {
        SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Vocк nгo pode usar esse comando!");
    }
}
Reply
#2

Aiai, mais um?

deus tem de piedade.. cancei vo fazer saporra de comando pra vc e edito samerda aqui!!

@edit, tai agora para de pedir samerda.. e estuda ele..

pawn Код:
if(strcmp(cmd, "/procurar", true) == 0 || strcmp(cmd, "/su", true) == 0)
    {
        new id[128],Pname[24],Sname[24],str[128],Sstr[128];
        GetPlayerName(playerid, Pname, sizeof(Pname));
        format(Sstr, sizeof(Sstr), "Contas/%s.ini", Pname);
        new prof = dini_Int(Sstr, "Profissao");
        new admm = dini_Int(Sstr, "pAdm01");
        if(prof == Policial_C || prof == Policial_F || prof == Recruta || prof == Bope || prof == Swat || prof == Rotam || prof == Policial_M || prof == FBI || prof == Interpol || admm == 1)
        {
            id = strtok(cmdtext, idx);
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++;}
            new offset = idx; new result[100];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; }
            result[idx - offset] = EOS;
           
            if(!strlen(id) || !strlen(result)) return SendClientMessage(playerid, 0xFFD39BAA, "Use: /procurar [id] [motivo] ou /su [id] [motivo]");
            if(IsPlayerConnected(strval(id)))
            {
                GetPlayerName(strval(id), Sname, sizeof(Sname));
                format(str, sizeof(str), "{0099FF}[x]{CCCCFF} Vocк foi colocado na lista de procurados pelo Policial %s || Motivo: %s", Pname, result);
                SendClientMessage(strval(id), 0xFFD39BAA, str);
                format(str, sizeof(str), "{0099FF}[x]{CCCCFF} O Jogador %s,  colocou %s na lista de procurados pelo motivo: %s!", Pname, Sname, result);
                SendClientMessageToAll(0xFFD39BAA, str);
                dini_IntSet(Sstr, "Procurado", dini_Int(Sstr, "Procurado")+1);
                SetPlayerWantedLevel(strval(id), GetPlayerWantedLevel(strval(id))+1);
                Procurados[strval(id)]++;
                return 1;
            }
            else return SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Jogador nгo conectado no momento!");
        }
        else return SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Vocк nгo pode usar esse comando!");
    }
testado..
Reply
#3

Anthery (sei lб seu nome/nick), pelamordeJБH.
O prуprio SAMP oferece suporte para vocк se vocк se dedicar ¬¬
Entre no https://sampwiki.blast.hk/ lб vocк aprende de TUDO sobre SAMP.

Favor, evite conflitos aqui no fуrum, pesquise antes de fazer o tуpico.

flw.
Reply
#4

ok no aguardo!
Reply
#5

ussa assim
pawn Код:
if(strcmp(cmd, "/procurar", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
   
    format(file, sizeof(file), "scriptfiles/Contas/%s.ini", playerid);
    if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Recruta || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Rotam || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "pAdm01") == 1)
    {

        new tmp[256];
        tmp = strtok(cmdtext, idx);

        new plid;
        plid = strval(tmp);

        if(!strlen(tmp))
        {
            SendClientMessage(playerid, 0xFFD39BAA, "Use: /procurar [id] [motivo] ou /su [id] [motivo]");
            return 1;
        }
        if(IsPlayerConnected(plid))
        {
            new str[128];
            new giveplayer[MAX_PLAYER_NAME];
            new sendername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, sendername, sizeof(sendername));
            GetPlayerName(plid, giveplayer, sizeof(giveplayer));

            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[100];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;

            format(str, sizeof(str), "{0099FF}[x]{CCCCFF} Vocк foi colocado na lista de procurados pelo Policial %s || Motivo: %s", sendername, (result));
            SendClientMessage(plid, 0xFFD39BAA, str);
            format(str, sizeof(str), "{0099FF}[x]{CCCCFF} O Jogador %s,  colocou %s na lista de procurados pelo motivo: %s!", playerid, giveplayer, (result));
            SendClientMessageToAll(0xFFD39BAA, str);

            new antes;
            antes=dini_Int(file, "Procurado");
            dini_IntSet(file, "Procurado", antes+1);
            SetPlayerWantedLevel(plid, GetPlayerWantedLevel(plid)+1);
            Procurados[plid]++;
            return 1;
        } else SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Jogador nгo conectado no momento!");
    } else SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Vocк nгo pode usar esse comando!");
    return true;
}
Reply
#6

Editei lб.. sу pegar.. eu testei aqui funcionou perfeitamente.

agora para de pedir a mesma coisa ok?? e vai estudar.
Reply
#7

Mano mais qualquer 1 pode usar
Reply
#8

Quote:
Originally Posted by Arthenry
Посмотреть сообщение
Mano mais qualquer 1 pode usar
qualquer um nгo!

se aconteceu isso ai entгo ou vc fez merda na hora de colocar ou definiu as profiзхes erradas

if(prof == Policial_C || prof == Policial_F || prof == Recruta || prof == Bope || prof == Swat || prof == Rotam || prof == Policial_M || prof == FBI || prof == Interpol || admm == 1)

esse codigo acima, faz verificar se o cara й plicialc, policialf,recruta etc.. so quem tiver dentro desse if ai q pode usar.

eu testei aqui, e esta certinho.
Reply
#9

entгo quer dizer que o seu comando ta funcionadno certissimo nй ?
Deu error:
e outra coisa apareзe assim O jogador 0, colocou o jogador Fulano pelo motivo: teste. tinha que ser o Jogador fulano, colocou na lista de procurados o Fulano pelo motivo>: teste

pawn Код:
C:\Documents and Settings\Vinнcius\Desktop\New Virtual City\gamemodes\NVC.pwn(10253) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#10

Quote:
Originally Posted by Arthenry
Посмотреть сообщение
entгo quer dizer que o seu comando ta funcionadno certissimo nй ?
Deu error:
e outra coisa apareзe assim O jogador 0, colocou o jogador Fulano pelo motivo: teste. tinha que ser o Jogador fulano, colocou na lista de procurados o Fulano pelo motivo>: teste

pawn Код:
C:\Documents and Settings\Vinнcius\Desktop\New Virtual City\gamemodes\NVC.pwn(10253) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Sim senhora, ta funcionando certinho..

Kra vc ta fazendo merda.. segue o print:

[Image: sa-mp-079.PNG]

Diz me se nгo й isso que queres??

Edit, duvido muito q esse erro ai seja no comando q eu postei.. sendo q aqui compilou normal, e te mandei atй o printe.

sendo assim, posta a devida linha do erro.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)