An offline ban command
#5

try:
pawn Код:
YCMD:offlineban(playerid, params[])
{
       new playerb[32], string[128], file[32];
       if(sscanf(params, "s[32]s[128]", playerb, params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /offlineban [playername] [reason]");
       format(file, sizeof(file), "users/%s.ini", playerb);
    if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GREY, "Player name not found.");
    format(string, sizeof(string), "AdmCmd: %s has been offline-banned by %s, reason: %s", playerb, RPN(playerid), params);
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    format(string, sizeof(string), "AdmCmd: %s has been offline-banned by %s (%s), reason: %s", playerb, GetPlayerName(playerid) , PIP(playerid), params);
    // Banning
    dini_IntSet(file, "pBanned", 1);
    // BanList
    new File:ban = fopen("ban.cfg", io_append);
    format(string, sizeof(string), "%s\r\n", dini_Get(file, "IP"));
    fwrite(ban, string);
    fclose(ban);
    return 1;
}

//and somewhere on the bottom of the script
stock PIP(playerid)
{
    new ip[16];
    GetPlayerIp(playerid, ip, sizeof(ip));
    return ip;
}
Reply


Messages In This Thread
An offline ban command - by HydraX - 06.09.2012, 23:10
Respuesta: An offline ban command - by HydraX - 06.09.2012, 23:43
Re: An offline ban command - by [ABK]Antonio - 06.09.2012, 23:45
Respuesta: Re: An offline ban command - by HydraX - 06.09.2012, 23:49
Re: An offline ban command - by Penki4a - 07.09.2012, 01:27
Respuesta: Re: An offline ban command - by HydraX - 07.09.2012, 01:59
Re: An offline ban command - by [HiC]TheKiller - 07.09.2012, 06:50
Re : An offline ban command - by ricardo178 - 07.09.2012, 07:26
Respuesta: Re: An offline ban command - by HydraX - 07.09.2012, 20:20

Forum Jump:


Users browsing this thread: 1 Guest(s)