SA-MP Forums Archive
Argument type mismatch (argument 1) - 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: Argument type mismatch (argument 1) (/showthread.php?tid=305928)



Argument type mismatch (argument 1) - §с†¶e®РµРe - 24.12.2011

pawn Code:
if (sscanf(params, "c[128]", radio))
    {
    return SendClientMessage(playerid, 0xFF0000AA, "Usage: /radio <ur radio>");
    }
I am getting these errors

pawn Code:
C:\Users\Haardik\Desktop\My Things\My things\Filterscripts\customradio.pwn(11) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Help Please


Re: Argument type mismatch (argument 1) - coole210 - 24.12.2011

Try

Code:
if (sscanf(params, "s[128]", radio))
    {
    return SendClientMessage(playerid, 0xFF0000AA, "Usage: /radio <ur radio>");
    }



Re: Argument type mismatch (argument 1) - Johndaonee - 24.12.2011

pawn Code:
new radio[128];
if(sscanf(params, "s[128]", radio)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /radio <ur radio>");



Re: Argument type mismatch (argument 1) - §с†¶e®РµРe - 24.12.2011

Not working


Re: Argument type mismatch (argument 1) - Thresholdold - 24.12.2011

You shouldn't have the return in "return SendClientMessage..."


Re: Argument type mismatch (argument 1) - §с†¶e®РµРe - 24.12.2011

pls give code i didnt understand


Re: Argument type mismatch (argument 1) - Thresholdold - 24.12.2011

pawn Code:
if (sscanf(params, "s[128]", radio))
    {
    SendClientMessage(playerid, 0xFF0000AA, "Usage: /radio <ur radio>");
    }
add return 1; after if you want to...


Re: Argument type mismatch (argument 1) - Johndaonee - 24.12.2011

I think you should give some code, post the whole command so we can fix it for you properly.


Re: Argument type mismatch (argument 1) - Thresholdold - 24.12.2011

He has given us sufficient code... he has the line giving the error, and the few lines before and after the error line.


Re: Argument type mismatch (argument 1) - §с†¶e®РµРe - 24.12.2011

same error


Re: Argument type mismatch (argument 1) - Thresholdold - 24.12.2011

that's what usually causes my argument type mismatch :S


Re: Argument type mismatch (argument 1) - Johndaonee - 24.12.2011

Get ouf of here, I cant believe it


Re: Argument type mismatch (argument 1) - Gh05t_ - 24.12.2011

Quote:
Originally Posted by Threshold
View Post
You shouldn't have the return in "return SendClientMessage..."
Yes, you may. Return statements extend the purpose of assigning true or false values. Anything proceeding the return statement is omitted.

pawn Code:
Function1()
{
    new bool:test = true;
    if(test == true) print("1");
    print("0");
}
pawn Code:
Function2()
{
    new bool:test = true;
    if(test == true) return print("1");
    print("0");
    return true;
}
pawn Code:
main()
{
    Function1();
    print("------");
    Function2();
}
@§с†¶e®РµРe:

pawn Code:
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /radio <ur radio>");



Re: Argument type mismatch (argument 1) - §с†¶e®РµРe - 24.12.2011

But if I use the code above I won't be able to save the string written after /radio in a variable (radio)


Re: Argument type mismatch (argument 1) - kizla - 24.12.2011

pawn Code:
new radio[128];
if(sscanf(params, "s[128]", radio))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /radio <ur radio>");
try


Re: Argument type mismatch (argument 1) - Mosslah - 24.12.2011

pawn Code:
new radio[128];
if(sscanf(params, "s[128]", radio))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /radio <ur radio>");
If this does not work for you, then your problem may be outside of this line - as this should work.


Re: Argument type mismatch (argument 1) - Dark_Kostas - 24.12.2011

Can you show us your whole command? The problem is probably at the "params" string and the way you get it.