23.07.2015, 01:03
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; }