Argument type mismatch (argument 1)
#1

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

Try

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

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

Not working
Reply
#5

You shouldn't have the return in "return SendClientMessage..."
Reply
#6

pls give code i didnt understand
Reply
#7

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

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

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

same error
Reply
#11

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

Get ouf of here, I cant believe it
Reply
#13

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

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

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

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.
Reply
#17

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


Forum Jump:


Users browsing this thread: 1 Guest(s)