[HELp]IRC comamdns fucking crap
#1

pawn Код:
IRCCMD:admban(botid, channel[], user[], host[], params[])
{
    // Check if the user is at least an op in the channel
    if (IRC_IsOp(botid, channel, user))
    {
        new playerid, reason[64];
        // Check if the user at least entered a player ID
        if (sscanf(params, "dS(No reason)[64]", playerid, reason))
        {
            return 1;
        }
        // Check if the player is connected
        if (IsPlayerConnected(playerid))
        {
            // Echo the formatted message
            new msg[128], namea[MAX_PLAYER_NAME];
            new string[300];
            new year, month, day, hour, minute, second;
            getdate(year, month, day);
            gettime(hour, minute, second);
            GetPlayerName(playerid, namea, sizeof(namea));
            format(msg, sizeof(msg), "YG IRC-INFO - %s (ID: %d) has been banned by Administrator %s (#ygirc[0.3x])[reason: %s]", namea, playerid, user, reason);
            IRC_GroupSay(groupID, channel, msg);
            format(msg, sizeof(msg), "YG IRC-INFO - %s (ID: %d) has been banned by Administrator %s (#ygirc[0.3x])[reason: %s]", namea, playerid, user, reason);
            SendClientMessageToAll(red, msg);
            SendClientMessage(playerid, red, "YOU HAVE BEEN RANGE BANNED - READ THE FOLLOWING DETAILS:");
            format(string, sizeof(string), "Your Name: %s", namea);
            SendClientMessage(playerid, yellow, string);
            format(string, sizeof(string), "Admin Name: %s", user);
            SendClientMessage(playerid, yellow, string);
            format(string, sizeof(string), "Date And Time: %d/%d/%d %d:%d", day, month, year, hour, minute);
            SendClientMessage(playerid, yellow, string);
            format(string, sizeof(string), "Reason: %s", reason);
            SendClientMessage(playerid, yellow, string);
            SendClientMessage(playerid, yellow, "(If You Wish To Make an Appeal goto YG-Gamers.tk and post in the Unban Appeals Category.)");
            SendClientMessage(playerid, red, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
            BanEx(playerid, reason);
        }
    }
    return 1;
}
help went i ban is doesn't show the SendClient Message ! for the banned guy
Reply
#2

You have to use a timer such as:

Anywhere on your script:

Код:
forward ban(playerid);
public ban(playerid)
{
        Ban(playerid);
        return 1;
}
Whereever you want to ban:

Код:
SetTimerEx("ban",10, false, "i", targetplayer);
Reply
#3

what the SetTimerEx where do i put ?
Reply
#4

It would be like this, But it won't save the reason, Use your own system to save it.

Код:
IRCCMD:admban(botid, channel[], user[], host[], params[])
{
    // Check if the user is at least an op in the channel
    if (IRC_IsOp(botid, channel, user))
    {
        new playerid, reason[64];
        // Check if the user at least entered a player ID
        if (sscanf(params, "dS(No reason)[64]", playerid, reason))
        {
            return 1;
        }
        // Check if the player is connected
        if (IsPlayerConnected(playerid))
        {
            // Echo the formatted message
            new msg[128], namea[MAX_PLAYER_NAME];
            new string[300];
            new year, month, day, hour, minute, second;
            getdate(year, month, day);
            gettime(hour, minute, second);
            GetPlayerName(playerid, namea, sizeof(namea));
            format(msg, sizeof(msg), "YG IRC-INFO - %s (ID: %d) has been banned by Administrator %s (#ygirc[0.3x])[reason: %s]", namea, playerid, user, reason);
            IRC_GroupSay(groupID, channel, msg);
            format(msg, sizeof(msg), "YG IRC-INFO - %s (ID: %d) has been banned by Administrator %s (#ygirc[0.3x])[reason: %s]", namea, playerid, user, reason);
            SendClientMessageToAll(red, msg);
            SendClientMessage(playerid, red, "YOU HAVE BEEN RANGE BANNED - READ THE FOLLOWING DETAILS:");
            format(string, sizeof(string), "Your Name: %s", namea);
            SendClientMessage(playerid, yellow, string);
            format(string, sizeof(string), "Admin Name: %s", user);
            SendClientMessage(playerid, yellow, string);
            format(string, sizeof(string), "Date And Time: %d/%d/%d %d:%d", day, month, year, hour, minute);
            SendClientMessage(playerid, yellow, string);
            format(string, sizeof(string), "Reason: %s", reason);
            SendClientMessage(playerid, yellow, string);
            SendClientMessage(playerid, yellow, "(If You Wish To Make an Appeal goto YG-Gamers.tk and post in the Unban Appeals Category.)");
            SendClientMessage(playerid, red, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
            SetTimerEx("ban",10, false, "i", playerid);
        }
    }
    return 1;
}

forward ban(playerid);
public ban(playerid)
{
        Ban(playerid);
        return 1;
}
Reply
#5

what the you mean is won't save the reason xD ?
Reply
#6

It saves that the player is banned, But the reason won't be saved in files, So you have to make a file called "Bans" and save the reasons there, Depends on what saving system you're using.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)