(1500)error 035: argument type mismatch (argument 2)
#1

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);
Reply
#2

change tmp to tmp[24] && s to s[24]
Reply
#3

Thanks it worked Reped+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)