SA-MP Forums Archive
Argument type mismatch. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Argument type mismatch. (/showthread.php?tid=624768)



Argument type mismatch. - SukMathcuck - 22.12.2016

I made this code the same does not work correctly why?

Код:
\gamemode RP\gamemodes\Roleplay.pwn(853) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Argument type mismatch. - CutX - 22.12.2016

Quote:
Originally Posted by SukMathcuck
Посмотреть сообщение
I made this code the same does not work correctly why?

Код:
\gamemode RP\gamemodes\Roleplay.pwn(853) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
PHP код:
static stock SendAdminMessage(color, const str[], nivel)
{
    foreach(new 
iPlayer)
    {
       if(
Account[i][pAdmin] >= nivelSendSplitClientMessage(icolorstr); //error
    
}
    
printf("%s"str);
    return 
1;
}
stock SendSplitClientMessage(playeridcolortext[], minlen 110maxlen 120)
{
    new 
str[256];
    if(
strlen(text) > maxlen)
    {
        new 
pos maxlen;
        while(
text[--pos] > ' ') {}
        if(
pos minlenpos maxlen;
        
format(strsizeof(str), "%.*s ..."postext);
        
SendClientMessage(playeridcolorstr);
        
format(strsizeof(str), ".... %s"text[pos+1]);
        
SendClientMessage(playeridcolorstr);
    }
    else 
format(strsizeof(str), "%s"text), SendClientMessage(playeridcolorstr);
    return 
true;

static stock SendAdminMessage(color, const str[], nivel)
so str is a constant

stock SendSplitClientMessage(playerid, color, text[], minlen = 110, maxlen = 120)
but here the text[] is not, that's a argument type mismatch

just add "const" to text[]
stock SendSplitClientMessage(playerid, color, const text[], minlen = 110, maxlen = 120)


Re: Argument type mismatch. - SukMathcuck - 22.12.2016

reputed, topic closed, error fixed.


Re: Argument type mismatch. - Yaa - 22.12.2016

Quote:
Originally Posted by SukMathcuck
Посмотреть сообщение
reputed, topic closed, error fixed.
Don't remove code (Rule breaker)

if someone have same problem he can fix it with this exemple