[Ajuda] error 035: argument type mismatch (argument 2)
#1

Hello, I'm trying to put the cmd /procurados in dialog but it is giving these 3 errors .. I could not solve .. somebody can help me?

the code is this

Код:
cmd:procurados(playerid)
{
    if(IsACop(playerid))
    {
        new StringCat[256];
        strcat(StringCat, sizeof(StringCat),"- {FFFFFF}Atuais suspeitos procurados pelo(a) %s", OrgsNamesSmall[GetPlayerOrg(playerid)]);
        new lvlMin = 1,
            lvlMax = 999999;
        if(GetPlayerOrg(playerid) == TEAM_PM)
        {
            lvlMin = 5;
            lvlMax = 10;
        strcat(thestring, " (Level 5 а 10)", sizeof(thestring));
        }
        else if(GetPlayerOrg(playerid) == TEAM_PF)
        {
            lvlMin = 5;
            lvlMax = 20;
        strcat(thestring, " (Level 5 а 20)", sizeof(thestring));
        }
        else if(GetPlayerOrg(playerid) == TEAM_FA)
        {
            lvlMin = 10;
         strcat(thestring, " (Level 10+)", sizeof(thestring));
        }
        else if(GetPlayerOrg(playerid) == TEAM_PCIVIL)
        {
            lvlMax = 5;
        strcat(thestring, " (Level 1 а 5)", sizeof(thestring));
        }

        new bool:Found = false;
        SendClientMessage(playerid, COLOR_GREEN, thestring);
        foreach(new i: Player)
        {
            if(WantedPoints[i] >= lvlMin && WantedPoints[i] <= lvlMax)
            {
        strcat(StringCat, sizeof(StringCat),"- {FFFFFF}Elemento: %s(%d), Level %d.",PlayerGetName(i),i,WantedPoints[i]);
                Found = true;
            }
        }
        if(!Found)
        strcat(StringCat, sizeof(StringCat),"- {FFFFFF}Nenhum");
        ShowPlayerDialog(playerid, 4781, DIALOG_STYLE_TABLIST_HEADERS, "Procurados BSL", StringCat, "Fechar","Ok");
    }
    else
        SendClientMessage(playerid, COLOR_ERRO, "[Erro]: Vocк nгo й um PM / PF / FA / ROTA.");

    return true;
}
those are the errors


Код:
BSL\gamemodes\BSL.pwn(64481) : error 035: argument type mismatch (argument 2)
BSL\gamemodes\BSL.pwn(64488) : loose indentation
BSL\gamemodes\BSL.pwn(64494) : loose indentation
BSL\gamemodes\BSL.pwn(64499) : loose indentation
BSL\gamemodes\BSL.pwn(64504) : loose indentation
BSL\gamemodes\BSL.pwn(64513) : error 035: argument type mismatch (argument 2)
BSL\gamemodes\BSL.pwn(64514) : loose indentation
BSL\gamemodes\BSL.pwn(64518) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2016, ITB CompuPhase


3 Errors.
I'm learning it still mess with it. Sorry if the mistake is stupid, but I'm learning.
Reply
#2

Quote:

strcat(StringCat, sizeof(StringCat),"- {FFFFFF}Nenhum");

I think you should use format
Reply
#3

Desculpe, eu nгo consegui entender... Como que seria o cуdigo correto?
Reply
#4

My head is hurting. Please English only
Reply
#5

Ok, Sorry, I could not understand ... How would that be the correct code?
Reply
#6

Helpp.
Reply
#7

pawn Код:
format(StringCat, sizeof StringCat, "- {FFFFFF}Atuais suspeitos procurados pelo(a) %s", OrgsNamesSmall[GetPlayerOrg(playerid)], sizeof(StringCat));

format(StringCat, sizeof StringCat,"- {FFFFFF}Elemento: %s(%d), Level %d.",PlayerGetName(i),i,WantedPoints[i]); // format instead of strcat

strcat(StringCat, "- {FFFFFF}Nenhum", sizeof StringCat);
The destination's length is the latest parameter, also, fix your indentation.
Reply
#8

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
pawn Код:
format(StringCat, sizeof StringCat, "- {FFFFFF}Atuais suspeitos procurados pelo(a) %s", OrgsNamesSmall[GetPlayerOrg(playerid)], sizeof(StringCat));

format(StringCat, sizeof StringCat,"- {FFFFFF}Elemento: %s(%d), Level %d.",PlayerGetName(i),i,WantedPoints[i]); // format instead of strcat

strcat(StringCat, "- {FFFFFF}Nenhum", sizeof StringCat);
The destination's length is the latest parameter, also, fix your indentation.

Could you please pass this corrected code to me? Then I can understand where I'm going wrong.
Reply
#9

Quote:
Originally Posted by razorcrash
Посмотреть сообщение
Could you please pass this corrected code to me? Then I can understand where I'm going wrong.
Already did. Just replace your error lines consecutively by those I mentioned.
Reply
#10

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
Already did. Just replace your error lines consecutively by those I mentioned.
Could you put here how the lines should stay? Because I do not understand where the error is.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)