I didn't 'use' LuxAdmin or SA-MP bans Yet, just seen them. But I guess these ideas could help you out a bit:
- Copy the samp ban FS into Lux.
- Convert the ban commands of the FS into a function:
pawn Код:
COMMAND:ban(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[SAMP-BANS]: You need to be logged in as an RCON administrator to perform this!");
if(sscanf(params, "uis", ban_target, ban_time, ban_reason)) return SendClientMessage(playerid, COLOR_RED, "[SAMP-BAN]: Correct usage -> /ban <player> <time (minutes)> <reason>");
if(!IsPlayerConnected(ban_target)) return SendClientMessage(playerid, COLOR_RED, "[SAMP-BANS]: Player was not found!");
if(ban_time < 0) SendClientMessage(playerid, COLOR_RED, "[SAMP-BANS]: Please input a valid ban time!");
format(post_string, sizeof(post_string), "action=addban&apikey="#APIKEY"&ban_user=%s&ban_reason=%s&ban_admin=%s&ban_ip=%s&ban_time=%d",names[ban_target], ban_reason, names[playerid], ips[ban_target], ban_time);
HTTP(playerid, HTTP_POST, APIPATH, post_string, "OnBanResponse");
Kick(ban_target);
return 1;
}
to:
pawn Код:
stock SampBan(ban_target, ban_time, ban_reason)
{
format(post_string, sizeof(post_string), "action=addban&apikey="#APIKEY"&ban_user=%s&ban_reason=%s&ban_admin=%s&ban_ip=%s&ban_time=%d",names[ban_target], ban_reason, names[playerid], ips[ban_target], ban_time);
HTTP(playerid, HTTP_POST, APIPATH, post_string, "OnBanResponse");
Kick(ban_target);
}
Similarly convert the other commands and remove unnecessary variables.
- Now in the /ban command of LuxAdmin, add this:
SampBan(targetid, time/*0 if permanent*/, reason);
- And Copy the OnPlayerConnect functions on the FS into LuxAdmin OnPlayerConnect.