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

I'm trying to do the command to change the frequency by entering the frequency required in Dialog_Style_Input change that failed in this CMD part people see their faults and fears help easily. thanks

VietNamese (( mмnh đang thử lаm lại lệnh thay đổi tần số số bằng cбch nhập cбc tần số cần thiết trong Dialog_Style_Input thay đổi mа khфng thаnh cфng trong CMD nаy phần mọi người nhмn thấy lỗi của mмnh vа nỗi lo giъp đỡ một cбch dễ dаng. thanks
P/S: cбc bạn nаo Việt Nam biết về lỗi nаy giъp mмnh nha, cбm ơn nhiều))

CODE CMD English
Код:
CMD:setfreq(playerid, params[])
{
	new inputtext, frequency;
	if(sscanf(inputtext, u, frequency)) // <-- error 035: argument type mismatch (argument 1) In this Line
	{
		ShowPlayerDialog(playerid, DIALOG_TANSO, DIALOG_STYLE_INPUT, "Enter the frequency ", " frequency may be higher and lower than 9999999 -9999999! \ n HINT: Set up your frequency la 0, se ve radio default mode. ", "Choice ", " Cancel ");
	}
	return 1;
}
CODE CMD Vietnamese
Код:
CMD:setfreq(playerid, params[])
{
	new inputtext, frequency;
	if(sscanf(inputtext, u, frequency))
	{
		ShowPlayerDialog(playerid, DIALOG_TANSO, DIALOG_STYLE_INPUT, "Nhap Tan So", "Tan so co the cao hon -9999999 va thap hon 9999999!\n HINT: Thiet lap tan so cua ban la 0 , radio se ve che do mac dinh.", "Lua chon", "Huy bo");
	}
	return 1;
}
Thanks for the help!!! (( Cбm ơn vм sự giъp đỡ ))
Reply
#2

Why are you checking inputtext and frequency in the command which would make it more like /setfreq [FREQ] [FREQ]((Or whatever is inputtext used for)) However the error is because it should be like that:

if(!sscanf(params, "i", frequency))
{
/BLABLBALBALBLA
}
else return SendClientMessage(playerid, -1, "USAGE: /setfreq [FREQ]");

or you can use if(sscanf(params, "i", frequency)) return SendClientMessage(playerid, -1, "USAGE: /setfreq [FREQ]");
Reply
#3

PHP код:
if(sscanf(inputtext"u"frequency)) 
if(
sscanf(inputtext"s"frequency)) //string
if(sscanf(inputtext"i"frequency)) //number (0:inf)
if(sscanf(inputtext"d"frequency)) //number (-inf:inf) 
Reply
#4

I also replaced the line of code like this but still have 035 errors again and again I do not know why. This is my code people see nothing wrong here and help me fix it. Thanks again.

CODE CMD
Код:
CMD:setfreq(playerid, params[])
{
	new inputtext, frequency;
	if(sscanf(inputtext, "i", frequency)) // <-- error 035: argument type mismatch (argument 1) In this Line again
	{
		ShowPlayerDialog(playerid, DIALOG_TANSO, DIALOG_STYLE_INPUT, "Enter the frequency ", " frequency may be higher and lower than 9999999 -9999999! \ n HINT: Set up your frequency la 0, se ve radio default mode. ", "Choice ", " Cancel ");
	}
	return 1;
}
CODE OnDialogresponse
Код:
if(dialogid == DIALOG_TANSO)
	{
		if(response)
		{
		    new frequency;
			if(frequency > 9999999 || frequency < -9999999)
			{
			return 1;
			}
			if (PlayerInfo[playerid][pRadio] == 1)
			{
				PlayerInfo[playerid][pRadioFreq] = frequency;
				format(string, sizeof(string), "you have been changed the frequency %s khz.",frequency);
				SendClientMessageEx(playerid, COLOR_WHITE, string);
			}
		}
		else SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have frequency !");
		return 1;
	}
Reply
#5

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:
if(sscanf(inputtext"u"frequency)) 
if(
sscanf(inputtext"s"frequency)) //string
if(sscanf(inputtext"i"frequency)) //number (0:inf)
if(sscanf(inputtext"d"frequency)) //number (-inf:inf) 
I need Your help
Reply
#6

PHP код:
CMD:setfreq(playeridparams[])
{
    new 
frequency;
    if(!
sscanf(params"i"frequency))
    {
        
ShowPlayerDialog(playeridDIALOG_TANSODIALOG_STYLE_INPUT"Enter the frequency "" frequency may be higher and lower than 9999999 -9999999! \ n HINT: Set up your frequency la 0, se ve radio default mode. ""Choice "" Cancel ");
    }
    return 
1;

//edit if(!sscanf(params, "i", frequency))
Reply
#7

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:
CMD:setfreq(playeridparams[])
{
    new 
frequency;
    if(!
sscanf(params"i"frequency))
    {
        
ShowPlayerDialog(playeridDIALOG_TANSODIALOG_STYLE_INPUT"Enter the frequency "" frequency may be higher and lower than 9999999 -9999999! \ n HINT: Set up your frequency la 0, se ve radio default mode. ""Choice "" Cancel ");
    }
    return 
1;

//edit if(!sscanf(params, "i", frequency))
you can just fix it yourself how not because this is my first time doing this code CMD Input format
Reply
#8

Did you fix your code? If not, what are the errors and the lines?
Reply
#9

Quote:
Originally Posted by Unte99
Посмотреть сообщение
Did you fix your code? If not, what are the errors and the lines?
Код:
CMD:setfreq(playerid, params[])
{
	new inputtext, frequency;
	if(sscanf(inputtext, "i", frequency)) // <-- error 035: argument type mismatch (argument 1) In this Line again
	{
		ShowPlayerDialog(playerid, DIALOG_TANSO, DIALOG_STYLE_INPUT, "Enter the frequency ", " frequency may be higher and lower than 9999999 -9999999! \ n HINT: Set up your frequency la 0, se ve radio default mode. ", "Choice ", " Cancel ");
	}
	return 1;
}
This Line If(sscanf(inputtext, "i", frequency)) is was error 035, And I don't know how to fix that @@. Help me
Reply
#10

Quote:
Originally Posted by Rayoung
Посмотреть сообщение
Код:
CMD:setfreq(playerid, params[])
{
	new inputtext, frequency;
	if(sscanf(inputtext, "i", frequency)) // <-- error 035: argument type mismatch (argument 1) In this Line again
	{
		ShowPlayerDialog(playerid, DIALOG_TANSO, DIALOG_STYLE_INPUT, "Enter the frequency ", " frequency may be higher and lower than 9999999 -9999999! \ n HINT: Set up your frequency la 0, se ve radio default mode. ", "Choice ", " Cancel ");
	}
	return 1;
}
This Line If(sscanf(inputtext, "i", frequency)) is was error 035, And I don't know how to fix that @@. Help me
You must not change params into anything.

Код:
if(sscanf(params, "i", frequency))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)