SA-MP Forums Archive
(1500)error 035: argument type mismatch (argument 2) - 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: (1500)error 035: argument type mismatch (argument 2) (/showthread.php?tid=304191)



(1500)error 035: argument type mismatch (argument 2) - §с†¶e®РµРe - 17.12.2011

pawn Code:
CMD:setname(playerid, params[])
    {   new giveplayerid;
        new tmp;
        if(sscanf(params, "us", giveplayerid, tmp))
        {
        SendClientMessage(playerid, 0xFFFFFFAA, "/setname [Playerid/PartOfName] [NewName]");
         return 1;
        }
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 4)
            {   new string[256];
                format(string, sizeof(string), "%s.ini", tmp);
                if(fexist(string))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "   That Name is registered !");
                    return 1;
                }
                if(IsPlayerConnected(giveplayerid))
                {   new string2[256];
                    format(string, sizeof(string), "%s.ini", PlayerName(giveplayerid));
                    dini_Remove(string);
                    format(string2, sizeof(string2), "%s.ini", tmp);
                    dini_Create(string2);
                    SetPlayerName(giveplayerid, tmp);
                    format(string, sizeof(string), "You have set %s's name to %s", PlayerName(giveplayerid), tmp);
                    SendClientMessage(playerid, COLOR_GREY, string);
                    format(string, sizeof(string), "Your name has been changed from %s to %s", PlayerName(giveplayerid), tmp);
                    SendClientMessage(giveplayerid, COLOR_YELLOW, string);
                    SaveAccounts();
                    OnPlayerDataSave(playerid);

                }
                else
                {
                    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
                    SendClientMessage(playerid, COLOR_GRAD2, string);
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
        }
        return 1;
    }
I put this code and when i try to compile my script the error comes
pawn Code:
(1500)error 035: argument type mismatch (argument 2)
Line 1500 -
pawn Code:
SetPlayerName(giveplayerid, tmp);



Re: (1500)error 035: argument type mismatch (argument 2) - [ABK]Antonio - 17.12.2011

change tmp to tmp[24] && s to s[24]


Re: (1500)error 035: argument type mismatch (argument 2) - §с†¶e®РµРe - 17.12.2011

Thanks it worked Reped+