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



Argument type mismatch. - danielpalade - 15.09.2016

This is the code:
Код:
	if(dialogid == DIALOG_HSHOP_PRIVATEFREQ)
	{
		if(response)
		{
			new user_freq = strval(inputtext);
			new user_done_freq = strlen(user_freq);
			if(user_done_freq < 1 || user_done_freq > 7) return SCM(playerid, -1, "Frecventa trebuie sa fie intre 1 si 7 caractere.");
			OnPlayerGetFreeFreq(playerid, user_freq);
		}
	}
I get the error for this line:
Код:
new user_done_freq = strlen(user_freq);



Re: Argument type mismatch. - Marricio - 15.09.2016

You're trying to get the string length of a integer. I think you're trying to achieve this:

pawn Код:
new user_freq = strval(inputtext); // This gets the numeric value of a string
new user_done_freq = strlen(inputtext); // This gets the length of a string.