21.01.2012, 19:38
use this:
pawn Код:
public SHOBanEx(playerid, reason[384])
{
new shoquery[384];
GetPlayerName(playerid, shoname, sizeof(shoname));
GetPlayerIp(playerid, shoIP, sizeof(shoIP));
gettime(shoHour, shoMinute, shoSecond);
getdate(shoYear, shoMonth, shoDay);
format(shostring, sizeof(shostring), "%d:%d/%d/%d/%d",shoHour,shoMinute,shoDay,shoMonth,shoYear);
format(shoquery, sizeof(shoquery), "UPDATE `%s`.`SAMP_USERLOG` SET `banned` = '0' WHERE `SAMP_USERLOG`.`playername` = '%s' LIMIT 1", SQL_DB, shoname);
mysql_query(shoquery);
format(shoquery, sizeof(shoquery), "INSERT INTO `%s`.`SAMP` (`playername` ,`IP` ,`reason` ,`admin` ,`start` ,`expires`) VALUES ('%s', '%s', '%s', 'In-Game Ban', '%s', '0')", SQL_DB, shoname, shoIP, reason, shostring);
mysql_query(shoquery);
SendClientMessage(playerid, COLOR_SHBANDENY, "You have been banned from the server!");
Kick(playerid);
return 1;
}