Argument Type Missmatch
#1

Please help me with this code, I've tried to make a login/register script, but i encountered these errors:

C:\Users\Adi\Desktop\Test\gamemodes\new.pwn(297) : error 035: argument type mismatch (argument 1)
C:\Users\Adi\Desktop\Test\gamemodes\new.pwn(310) : error 035: argument type mismatch (argument 1)
C:\Users\Adi\Desktop\Test\gamemodes\new.pwn(342) : error 035: argument type mismatch (argument 1)
C:\Users\Adi\Desktop\Test\gamemodes\new.pwn(344) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Here's the script:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
		case DIALOG_REGISTER:
		{
            if(!response) return Kick(playerid);
			if(strlen(inputtext) < 3 && strlen(inputtext) > 20)
		    {
		        new Name[MAX_PLAYER_NAME],string[256],escaped[128];
		        GetPlayerName(playerid,Name,sizeof(Name));
		        mysql_escape_string(inputtext,escaped); 
				format(string,sizeof(string),"INSERT INTO `users` (`username`, `password`) VALUES ('%s', ('%s'))",Name,escaped);
				mysql_query(string); // line 297 <<<<<<<<<<<<<<
		    }
		    else
		    {
				SendClientMessage(playerid,COLOR_WHITE,"Your password is too short or too long!");
		    }
		}
		case DIALOG_LOGIN:
		{
            if(!response) return Kick(playerid);
			new string[256],password[128],Name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,Name,sizeof(Name));
			format(string,sizeof(string),"SELECT `password` FROM `users` WHERE `username` = '%s'",Name);
			mysql_query(string); // line 310 <<<<<<<<<<<<<<
			cache_get_query_string(password);
			if(strcmp(inputtext,password))
			{
			    new text[128];
			    format(text,sizeof(text),"Welcome back %s! You are now logged in",Name);
			    SendClientMessage(playerid,COLOR_YELLOW,Name);
				printf("%s has logged in.",Name);
				LoggedIn[playerid] = 1;
			}
		}
	}
	return 1;
}

stock CheckAccount(account[])
{
    new string[256];
	format(string, sizeof(string), "SELECT * FROM Users WHERE Name = '%s'", account);
	mysql_query(string); // line 342 <<<<<<<<<<<<<<
	new row;
	cache_get_query_string(row); // line 344 <<<<<<<<<<<<<<
	if(row > 0)
	{
	    return 1;
	}
	else
	{
	    return 0;
	}
}
Reply
#2

-DELETED-
Reply
#3

highlight the lines, or just show me the 4 lines with the errors below the whole code, as I CBF to check the syntax you've used for every function.
Reply
#4

Код:
mysql_query(string); // line 297
mysql_query(string); // line 310
mysql_query(string); // line 342
cache_get_query_string(row); // line 344
Reply
#5

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
highlight the lines, or just show me the 4 lines with the errors below the whole code, as I CBF to check the syntax you've used for every function.
It's something wrong with the mysql_query
Reply
#6

Well there is no tag mismatch there... A tag mismatch is where you put the wrong data type for a function.

Example: function(integer, string); and the function asks for function(string, string);

The only thing I can think of it being is, a problem with the function MySQL_Query. Have you edited it? Which to be honest I doubt you have.
Reply
#7

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
Well there is no tag mismatch there... A tag mismatch is where you put the wrong data type for a function.

Example: function(integer, string); and the function asks for function(string, string);

The only thing I can think of it being is, a problem with the function MySQL_Query. Have you edited it? Which to be honest I doubt you have.
No, I didn't.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)