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 i: Player)
{
if(Account[i][pAdmin] >= nivel) SendSplitClientMessage(i, color, str); //error
}
printf("%s", str);
return 1;
}
stock SendSplitClientMessage(playerid, color, text[], minlen = 110, maxlen = 120)
{
new str[256];
if(strlen(text) > maxlen)
{
new pos = maxlen;
while(text[--pos] > ' ') {}
if(pos < minlen) pos = maxlen;
format(str, sizeof(str), "%.*s ...", pos, text);
SendClientMessage(playerid, color, str);
format(str, sizeof(str), ".... %s", text[pos+1]);
SendClientMessage(playerid, color, str);
}
else format(str, sizeof(str), "%s", text), SendClientMessage(playerid, color, str);
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)