unban command not functioning properly(SQLite)
#2

I'm not 100% sure if this would work, as I have no knowledge of SQ lite, but I don't think those extra returns had to be there so it's worth a try

Код:
CMD:unban(playerid, params[])
{
	new name[24], string[128], Query[500], DBResult:Result;
	if(dAdmin[playerid][USER_ADMIN] == 3)
	{
	    if(sscanf(params, "s[24]", name)) return SendClientMessage(playerid, -1, "[USAGE]/unban (name)");
	    else
	    {
			format(Query, sizeof(Query), "SELECT banned FROM users WHERE username = '%s'", DB_Escape(name));
			Result = db_query(Database, Query);
			if(db_num_rows(Result))
			{
				format(Query, sizeof(Query), "UPDATE users SET banned = 0 WHERE username = '%s'", DB_Escape(name));
				Result = db_query(Database, Query);

				format(string, sizeof(string), "Player %s's ban was set to 0.", name);
				print(string);
			}
			db_free_result(Result);
		}
	}
	return 1;
}
Reply


Messages In This Thread
unban command not functioning properly(SQLite) - by DarkLored - 27.08.2015, 21:57
Re: unban command not functioning properly(SQLite) - by CadSives - 27.08.2015, 22:07
Re: unban command not functioning properly(SQLite) - by Jefff - 27.08.2015, 22:16
Re: unban command not functioning properly(SQLite) - by DarkLored - 28.08.2015, 01:05

Forum Jump:


Users browsing this thread: 1 Guest(s)