Transfering mysql r5 in r39-3
#1

I'm seeking I can help get a gm on mysql r39-3?
Код:
forward BanCheck(i);
public BanCheck(i)
{
    new name[32], query[256], qwr[256], result[256], string[256],d,m,y,h,mi,s;
    getdate(y,m,d); gettime(h,mi,s);
    GetPlayerName(i, name, sizeof(name));
    format(query,sizeof(query),"SELECT * FROM `bans` WHERE Name = '%s'",name);
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows())
    {
        mysql_get_field("Permanent", result);    PlayerBan[i][pType] = strval(result);
        mysql_get_field("Day", result);          PlayerBan[i][pDay] = strval(result);
        mysql_get_field("Month", result);        PlayerBan[i][pMonth] = strval(result);
        mysql_get_field("Year", result);         PlayerBan[i][pYear] = strval(result);
        mysql_get_field("Hour", result);         PlayerBan[i][pHour] = strval(result);
        mysql_get_field("Minutes", result);      PlayerBan[i][pMinutes] = strval(result);
        mysql_get_field("Seconds", result);      PlayerBan[i][pSeconds] = strval(result);
        mysql_fetch_field_row(result, "Reason"); format(PlayerBan[i][pReason],128,result);
        mysql_fetch_field_row(result, "Admin"); format(PlayerBan[i][pAdmin],128,result);
        mysql_fetch_field_row(result, "BanDate"); format(PlayerBan[i][pBanDate],128,result);
        if(PlayerBan[i][pType] == 1)
        {
            format(string,sizeof(string),"{FFFFFF}__________________________________________________________________",name);
            SendClientMessage(i,-1,string);
            format(string,sizeof(string),"{99CCFF}Ban Info {FF1919}%s {99CCFF}- %s",name,PlayerBan[i][pBanDate]);
            SendClientMessage(i,-1,string);
            format(string,sizeof(string),"{99CCFF}Account name: {FF1919}%s",name);
            SendClientMessage(i,-1,string);
            format(string,sizeof(string),"{99CCFF}Admin who banned you: {FF1919}%s",PlayerBan[i][pAdmin]);
            SendClientMessage(i,-1,string);
            format(string,sizeof(string),"{99CCFF}Reason: {FF1919}%s",PlayerBan[i][pReason]);
            SendClientMessage(i,-1,string);
            format(string,sizeof(string),"{99CCFF}Ban date: {FF1919}%s",PlayerBan[i][pBanDate]);
            SendClientMessage(i,-1,string);
            format(string,sizeof(string),"{99CCFF}Expiration date: {FF1919}Never, permanent.",PlayerBan[i][pDay],PlayerBan[i][pMonth],PlayerBan[i][pYear],PlayerBan[i][pHour],PlayerBan[i][pMinutes],PlayerBan[i][pSeconds]);
            SendClientMessage(i,-1,string);
            format(string,sizeof(string),"{99CCFF}For unban enter on the forum: {FF1919}WWW.PG-ZONE.RO{99CCFF}.");
            SendClientMessage(i,-1,string);
            format(string,sizeof(string),"{FFFFFF}__________________________________________________________________",name);
            SendClientMessage(i,-1,string);
            SetTimerEx("Kicks", 1000, false, "i", i);
        }
        else
        {
            if((d>PlayerBan[i][pDay] && m>=PlayerBan[i][pMonth] && y>=PlayerBan[i][pYear]) || (d>PlayerBan[i][pDay] && m==PlayerBan[i][pMonth]) || (m>PlayerBan[i][pMonth] ||
         y>PlayerBan[i][pYear]) || (d==PlayerBan[i][pDay] && m==PlayerBan[i][pMonth] && y==PlayerBan[i][pYear] && h>=PlayerBan[i][pHour] && mi>=PlayerBan[i][pMinutes]))
            {
                format(qwr,sizeof(qwr),"DELETE FROM `bans` WHERE Name = '%s'",name);
                mysql_query(string);
                format(qwr,sizeof(qwr),"SELECT * FROM players WHERE Name = '%s'",name);
                mysql_query(string);
            }
            else
            {
                format(string,sizeof(string),"{FFFFFF}__________________________________________________________________",name);
                SendClientMessage(i,-1,string);
                format(string,sizeof(string),"{99CCFF}Ban Info {FF1919}%s {99CCFF}- %s",name,PlayerBan[i][pBanDate]);
                SendClientMessage(i,-1,string);
                format(string,sizeof(string),"{99CCFF}Account name: {FF1919}%s",name);
                SendClientMessage(i,-1,string);
                format(string,sizeof(string),"{99CCFF}Admin who banned you: {FF1919}%s",PlayerBan[i][pAdmin]);
                SendClientMessage(i,-1,string);
                format(string,sizeof(string),"{99CCFF}Reason: {FF1919}%s",PlayerBan[i][pReason]);
                SendClientMessage(i,-1,string);
                format(string,sizeof(string),"{99CCFF}Ban date: {FF1919}%s",PlayerBan[i][pBanDate]);
                SendClientMessage(i,-1,string);
                format(string,sizeof(string),"{99CCFF}Expiration date: {FF1919}%i/%i/%i, %i:%i:%i",PlayerBan[i][pDay],PlayerBan[i][pMonth],PlayerBan[i][pYear],PlayerBan[i][pHour],PlayerBan[i][pMinutes],PlayerBan[i][pSeconds]);
                SendClientMessage(i,-1,string);
                format(string,sizeof(string),"{99CCFF}For unban enter on the forum: {FF1919}WWW.PG-ZONE.RO{99CCFF}.");
                SendClientMessage(i,-1,string);
                format(string,sizeof(string),"{FFFFFF}__________________________________________________________________",name);
                SendClientMessage(i,-1,string);
                SetTimerEx("Kicks", 1000, false, "i", i);
            }
        }
    }
    return 1;
}
Reply
#2

uppppp
Reply
#3

Open the include (a_mysql) and check for the new natives, consider structures and parameters
Reply
#4

? i don't know
Reply
#5

Dude the new versions are completely different from older ones, I recommend you to update to R39 but still use mysql_query for compatibility, you must have to remake the whole structure to use tquery or pquery, so it's most recommended for starting to update your system, only add a handler in each mysql_query and deal with cache functions. You also will lose a lot of functions that we're supported in R5 but aren't anymore in R39. Take a read on the R33+ Wiki page.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)