SA-MP Forums Archive
Little Help Please. - 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: Little Help Please. (/showthread.php?tid=452627)



error 035: argument type mismatch (argument 2) - Yves - 22.07.2013

the error
Код:
error 035: argument type mismatch (argument 2)
the code.
Код:
stock GetName(playerid)
{
    new
        name[24];
    GetPlayerName(playerid, name, sizeof(name));
    strreplace(name, '_', ' ');
    return name;
}
this is were the error is coming from
Код:
 strreplace(name, '_', ' ');



Re: Little Help Please. - OrMisicL - 22.07.2013

its obvious that the second parameter type is mismatch, my first guess is that the "strreplace" function that you're using takes 3 strings as parameters, which in this case you're passing one string and two characters hence the "type mismatch" error, so u simply have to replace character parameters with strings,
in other words, change all the ' to "


Re: Little Help Please. - Donvalley - 22.07.2013

change
pawn Код:
strreplace(name, '_', ' ');
to

pawn Код:
strreplace(name, "_", " ");