Argument type mismatch.
#2

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)
Reply


Messages In This Thread
Argument type mismatch. - by SukMathcuck - 22.12.2016, 14:46
Re: Argument type mismatch. - by CutX - 22.12.2016, 14:52
Re: Argument type mismatch. - by SukMathcuck - 22.12.2016, 16:55
Re: Argument type mismatch. - by Yaa - 22.12.2016, 18:41

Forum Jump:


Users browsing this thread: 1 Guest(s)