23.05.2017, 04:38
Код:
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)