17.06.2011, 18:47
How can I kick the mysql log? I give kick to appear in MySQL datebase?
I did something but not good ..
The kick command is:
I did something but not good ..
pawn Код:
public KickLog(playerid, reason[])
{
new query[128];
new year,month,day,hour,minute,second;
getdate(year, month, day),gettime(hour, minute, second);
format(query, sizeof(query), "INSERT INTO kicklog (username,day,moon,year,second,minute,hour,reason) VALUES ('%s','%d',%d,'%d','%d','%d','%d','%s')", ReturnName(playerid), day, month, year, second, minute, hour, reason);
mysql_query(query);
return 1;
}
pawn Код:
CMD:kick(playerid, params[])
{
new year, month,day, string[ 700 ], giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], result[ 700 ], giveplayerid;
if(IsPlayerConnected(playerid)) {
if (sscanf(params, "us", giveplayerid, result)) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /kick [playerid/PartOfName] [reason]");
if (PlayerInfo[playerid][pAdmin] >= 1) {
if(IsPlayerConnected(giveplayerid)) {
if(giveplayerid != INVALID_PLAYER_ID) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
getdate(year, month, day);
format(string, sizeof(string), "MySQL: %s was kicked by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, result,month,day,year);
KickLog(giveplayerid, result);
format(string, sizeof(string), "{FF0000}MySQL: {FFFFFF}%s was kicked by %s, reason: %s", giveplayer, sendername, result);
SendClientMessageToAll(0xAFAFAFAA, string);
Kick(giveplayerid);
return 1;
}
} else { format(string, 700, " %d is not an active player.", giveplayerid); SendClientMessage(playerid, 0xAFAFAFAA, string); return 1; }
} else return SendClientMessage(playerid, 0xAFAFAFAA, " you are not authorized to use that command!");
}
return 1;
}