mysql unban command
#1

I am not asking for a script. All I need is to know how I check if an account is in the database as mysql_num_rows was removed. I also do NOT want to go to an old version of the mysql plugin.
Reply
#2

I have this same issue! And also wondering how to get this working.
Reply
#3

pawn Код:
new rows, fields;
    cache_get_data(rows, fields);
    if(rows)
    {
        //Banned
    }
    else
    {
        //Not Banned
    }
Reply
#4

Quote:
Originally Posted by awsomedude
Посмотреть сообщение
pawn Код:
//code...
Why use that method when using:

pawn Код:
cache_num_rows();
is the same?

How are you un-banning? using DELETE or UPDATE?
Reply
#5

Quote:
Originally Posted by DobbysGamertag
Посмотреть сообщение
Why use that method when using:

pawn Код:
cache_num_rows();
is the same?

How are you un-banning? using DELETE or UPDATE?
I am using update as of now. If needed I can make a new table for the bans in order to delete. Which option is better? Thanks!
Reply
#6

Still does not work! Any help would be greatly appreciated.
Reply
#7

Bump!
Reply
#8

You should use cache_num_rows() as DobbysGamertag said.
pawn Код:
new query[126];
format(query, sizeof(query), "SELECT * FROM bantable WHERE BannedName = '%s' AND status = 1", GetPlayerNameEx(playerid));//Firstly we should select everything from your ban table however you named it.
mysql_tquery(mysql, query,"BanResults","i",playerid); //now we added a call back to check if this name is banned or not,


forward BanResults(playerid);
public BanResults(playerid)
{
    if(cache_num_rows(mysql) >=1)
    {
        //if this name was found.
    }
    else
    {
    //cannot find
    }
    return 1;
}
EDIT: This is a fast example taken from my gamemode, don't copy and paste you should modify it first!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)