SA-MP Forums Archive
[HELP] argument type mismatch - 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: [HELP] argument type mismatch (/showthread.php?tid=323628)



[HELP] argument type mismatch - Fredden1993 - 06.03.2012

As the title says.

pawn Код:
if(strcmp(cmd, "/clothes", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_DARKGREY, " You're not logged in yet.");
                return 1;
            }
            if(PlayerToPoint(6.0, playerid, 2104.1123,2257.2759,11.0234))
            {
                ShowPlayerDialog(playerid, 6, DIALOG_STYLE_INPUT, "Binco", "Type the ID of the skin you want below.", "Change", "Close" );
            }
            else
            {
                SendClientMessage(playerid, COLOR_DARKGREY, " You're not at a clothing store or at the faction spawn.");
            }
        }
        return 1;
    }
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 6:
        {
            if(!response)
            {
                return 1;
            }
            if(!strlen(inputtext))
            {
                ShowPlayerDialog(playerid, 6, DIALOG_STYLE_INPUT, "Binco", "Type the ID of the skin you want below.", "Change", "Close" );
            }
            else
            {
                SetPlayerSkin(playerid, inputtext); // argument type mismatch (argument 2)
            }
        }
    }
    return 0;
}



Re: [HELP] argument type mismatch - Konstantinos - 06.03.2012

Line?


Re: [HELP] argument type mismatch - [Diablo] - 06.03.2012

skin id is an integer, and inputtext is a string. use strval -> https://sampwiki.blast.hk/wiki/Strval
pawn Код:
SetPlayerSkin(playerid, strval(inputtext));
edit: can't test this atm.


Re: [HELP] argument type mismatch - Fredden1993 - 06.03.2012

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Line?
Check the 2nd pawn box, I've marked it with "//"...


Re: [HELP] argument type mismatch - Twisted_Insane - 06.03.2012

Change:

pawn Код:
SetPlayerSkin(playerid, inputtext);
to:
pawn Код:
SetPlayerSkin(playerid, strval(inputtext));



Re: [HELP] argument type mismatch - Fredden1993 - 06.03.2012

Quote:
Originally Posted by [Diablo]
Посмотреть сообщение
skin id is an integer, and inputtext is a string. use strval -> https://sampwiki.blast.hk/wiki/Strval
pawn Код:
SetPlayerSkin(playerid, strval(inputtext));
edit: can't test this atm.
That did it, thanks!