CMD:ban(playerid, params[])
{
if(pData[playerid][Admin] >= 4)
{
new string[135],estring[135],Query[300],plid,largestring[300];
if (sscanf(params, "us[200]", plid, estring)) return SendClientMessage(playerid,COLOR_YELLOW, "Usage: /ban <id> <reason>");
if (!IsPlayerConnected(plid)) return SendClientMessage(playerid,0xFF0000FF, "Player Not Connected!");
format(string, sizeof(string), "You have banned {FFFFFF}%s(%d)", PlayerName(plid), plid);
SendClientMessage(playerid, 0x66FF33, string);
format(largestring, sizeof(largestring), "Admin %s banned you from the server\r\nReason:%s", PlayerName(playerid), estring);
ShowPlayerDialog(plid, DIALOG_KICK, DIALOG_STYLE_MSGBOX, "You have been banned", largestring, "Ok", "Cancel");
GetPlayerIp(plid, PIP, 50);
new Hour, Minute, Second, Year, Month, Day;
gettime(Hour, Minute, Second);
getdate(Year, Month, Day);
format(string, sizeof(string), "%02d:%02d:%02d on %02d/%02d/%d", Hour, Minute, Second, Day, Month, Year);
mysql_format(connectionHandle,Query, sizeof(Query), "INSERT INTO `banlog` (`time`, `name`, `ip`, `reason`, `admin`, `banned`) VALUES ('%s', '%s', '%s', '%s', '%s', 1)", string, escpname(plid), PIP, escstring(estring), escpname(playerid));
mysql_query(connectionHandle, Query);
mysql_free_result();
Kick(plid);
}
return 1;
}
CMD:ban(playerid, params[]) { if(pData[playerid][Admin] >= 4) { new string[135],estring[135],Query[300],plid,largestring[300]; if (sscanf(params, "us[200]", plid, estring)) return SendClientMessage(playerid,COLOR_YELLOW, "Usage: /ban <id> <reason>"); if (!IsPlayerConnected(plid)) return SendClientMessage(playerid,0xFF0000FF, "Player Not Connected!"); format(string, sizeof(string), "You have banned {FFFFFF}%s(%d)", PlayerName(plid), plid); SendClientMessage(playerid, 0x66FF33, string); format(largestring, sizeof(largestring), "Admin %s banned you from the server\r\nReason:%s", PlayerName(playerid), estring); ShowPlayerDialog(plid, DIALOG_KICK, DIALOG_STYLE_MSGBOX, "You have been banned", largestring, "Ok", "Cancel"); GetPlayerIp(plid, PIP, 50); new Hour, Minute, Second, Year, Month, Day; gettime(Hour, Minute, Second); getdate(Year, Month, Day); format(string, sizeof(string), "%02d:%02d:%02d on %02d/%02d/%d", Hour, Minute, Second, Day, Month, Year); mysql_format(connectionHandle,Query, sizeof(Query), "INSERT INTO banlog(`time`, `name`, `ip`, `reason`, `admin`, `banned`) VALUES ('%s', '%s', '%s', '%s', '%s', 1)", string, escpname(plid), PIP, escstring(estring), escpname(playerid)); mysql_query(connectionHandle, Query); mysql_free_result(); Kick(plid); } return 1; }
new MDB;
MDB = mysql_connect(.....);
i do not use connectionHandle to connect mysql i use new mysql; but i added connectionHandle to make that codes because when i use mysql it say tag mich......
|
: warning 213: tag mismatch