SA-MP Forums Archive
How do I fix this error? - 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: How do I fix this error? (/showthread.php?tid=662169)



How do I fix this error? - aKnoxx - 25.12.2018

Code:
grandlarc.pwn(603) : error 035: argument type mismatch (argument 2)
PHP Code:
    if(dialogid==2)
    {
        if(
response)
        {
            new 
message[256];
            
format(message256"Your skin has been changed to %i."inputtext);
            
SendClientMessage(playerid, -1message);
            
SetPlayerSkin(playeridinputtext);    //line 603
                
return 1;
        }
        
    } 



Re: How do I fix this error? - iorp - 25.12.2018

you can not pass string array to the integer value

use this instead of inputtext

Code:
strvar(inputtext)
it will convert your string to the integer value


Re: How do I fix this error? - Nyzenic - 25.12.2018

Quote:
Originally Posted by iorp
View Post
you can not pass string array to the integer value

use this instead of inputtext

Code:
strvar(inputtext)
it will convert your string to the integer value
you mean strval
https://sampwiki.blast.hk/wiki/Strval
Code:
    if(dialogid==2) 
    { 
        if(response) 
        { 
            new message[256]; 
            format(message, 256, "Your skin has been changed to %i.", inputtext); 
            SendClientMessage(playerid, -1, message); 
            SetPlayerSkin(playerid, strval(inputtext));    //line 603 
                return 1; 
        } 
         
    }



Re: How do I fix this error? - iorp - 25.12.2018

Quote:
Originally Posted by zerruv
View Post
you mean strval
https://sampwiki.blast.hk/wiki/Strval
Code:
    if(dialogid==2) 
    { 
        if(response) 
        { 
            new message[256]; 
            format(message, 256, "Your skin has been changed to %i.", inputtext); 
            SendClientMessage(playerid, -1, message); 
            SetPlayerSkin(playerid, strval(inputtext));    //line 603 
                return 1; 
        } 
         
    }
yes, I meant to use strval for convert a string to integer