Error 001 and 035
#1

Код:
stock IsPlayerBanned(playerid)
{
  new query[200],
  format(query, sizeof(query), "SELECT * FROM accounts WHERE Name = '%s' AND Banned = 1 LIMIT 1", PlayerName(playerid));
  mysql_query(query);
  if(cache_num_rows() != 0)
  {
	SCM(playerid, COLOR_YELLOW, "______________________________________________________________________");
	SCM(playerid, COLOR_YELLOW, " ");
	SendClientMessage(playerid, COLOR_YELLOW, "You are BANNED");
	SendClientMessage(playerid, COLOR_YELLOW, "Please do not ban evading.");
	SendClientMessage(playerid, COLOR_YELLOW, "To get unbanned, contact an ADMIN");
	SCM(playerid, COLOR_YELLOW, "______________________________________________________________________");
	KickPlayer(playerid, "");
  }
  return 1;
}
Код:
  format(query, sizeof(query), "SELECT * FROM accounts WHERE Name = '%s' AND Banned = 1 LIMIT 1", PlayerName(playerid)); //error 001: expected token: ";", but found "(", warning 203: symbol is never used: "format", warning 219: local variable "format" shadows a variable at a preceding level

  mysql_query(query); //error 035: argument type mismatch (argument 1)
Thank you for your time and reading!
Reply
#2

Quote:
Originally Posted by Dutheil
Посмотреть сообщение
mysql_query has 2 mandatory arguments.
The first : Connection handle
The second : The query

https://sampwiki.blast.hk/wiki/MySQL/R33#mysql_query

PHP код:
mysql mysql_connect("host""user""database""pass");
mysql_query(mysqlquery); 
You need to include the database handler before the query.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)