Ban dialog
#1

Is there any way to create dialog after /ban ?

Like i did /ban 0 and then the 0 id will get a popup dialog with reason and admin name who banned him.

And when he try to reconnect his acc he will get a dialog with "Your account is banned and can be requested in *website* or etc"
Reply
#2

Format a string with the ban information and send the dialog to that playerid. Then use a timer; for example, after 500 milliseconds and Kick that player. The dialog will stay after they got banned.

When they connect again, after they have been banned check if they're banned and load the information. Do the same as above again, format a string with the ban information, send the dialog to the player and use the timer to Kick him.
Reply
#3

Can u explain me abit more ? -.-''

I am damn newbie
Reply
#4

My cmd scripts

pawn Код:
CMD:jail(playerid, params[])
{
    new str[150], id, time, reason[128];
    CL(playerid);
    if(pInfo[playerid][Admin] >= 2)
    {
        if(sscanf(params, "uiS(No Reason)[128]", id, time, reason))
        {
            SendClientMessage(playerid, COLOR_RED, "USAGE: /jail [playerid] [time] [reason]");
            SendClientMessage(playerid, COLOR_ORANGE, "Function: Jails specified player with specified time, Reason is optional!");
            return 1;
        }
        if(id == INVALID_PLAYER_ID) return Error(playerid, 0);
        if(id == playerid) return Error(playerid, 1);
        if(pInfo[playerid][Admin] < pInfo[id][Admin]) return Error(playerid, 8);
        if(pInfo[id][Jail] == 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is already in jail!");
        format(str, sizeof(str), "Administrator %s(ID:%d) has jailed %s(ID:%d) for %i minutes (Reason: %s)", GetName(playerid), playerid, GetName(id), id, time, reason);
        SendClientMessageToAll(COLOR_ORANGE, str);
        format(str, sizeof(str), "You jailed %s(ID:%d) for %i minutes (Reason: %s)", GetName(id), id, time, reason);
        SendClientMessage(playerid, COLOR_YELLOW, str);
        format(str, sizeof(str), "Administrator %s(ID:%d) has jailed you for %i minutes (Reason: %s)", GetName(playerid), playerid, time, reason);
        SendClientMessage(id, COLOR_RED, str);
        pInfo[id][JailTime] = time;
        SetTimerEx("JailPlayer", 5000, 0, "d", id);
        SetTimerEx("Jail1", 1000, 0, "d", id);
        SendCommandToAdmins(playerid,"JAIL");
    }
    else return Error(playerid, 4);
    return 1;
}
pawn Код:
CMD:ban(playerid, params[])
{
    new string[128], str[256], id, reason[128], ip[16], File:ipF;
    CL(playerid);
    if(pInfo[playerid][Admin] >= 3)
    {
        if(sscanf(params, "uS(No Reason)[128]", id, reason))
        {
            SendClientMessage(playerid, COLOR_RED, "USAGE: /ban [playerid] [reason]");
            SendClientMessage(playerid, COLOR_ORANGE, "Function: Custom Ban the specified player! (Custom Ban is still the same as the orig ban!)");
            return 1;
        }
        if(pInfo[playerid][Admin] < pInfo[id][Admin]) return Error(playerid, 8);
        if(id == INVALID_PLAYER_ID) return Error(playerid, 0);
        if(id == playerid) return Error(playerid, 1);
        ipF = fopen("JakAdmin/Config/banip.txt", io_write);
        GetPlayerIp(id, ip, sizeof(ip));
        format(str, sizeof(str), "%s\r\n", ip);
        fwrite(ipF, str);
        fclose(ipF);
        format(str, sizeof(str), "%s(%d) has been banned by Administrator %s(ID:%d) (Reason: %s) (Ip of Player: %s)", GetName(id), id, GetName(playerid), playerid, reason, ip);
        SaveIn("banlog.txt", str);
        format(string, sizeof(string), "You banned %s(ID:%d) (Reason: %s)", GetName(id), id, reason);
        SendClientMessage(playerid, COLOR_RED, string);
        format(string, sizeof(string), "%s(ID:%d) has been banned by Administrator %s(ID:%d) (Reason: %s)", GetName(id), id, GetName(playerid), playerid, reason);
        SendClientMessageToAll(COLOR_GREY, string);
        format(string, sizeof(string), "You have been banned by Administrator %s(ID:%d) (Reason: %s)", GetName(playerid), playerid, reason);
        SendClientMessage(id, COLOR_RED, string);
        pInfo[id][Banned] = 1;
        pInfo[id][Bans] += 1;
        LoadBlackIPs();
        KickTimer[id] = SetTimerEx("KickPlayer", 500, false, "d", id);
        SendCommandToAdmins(playerid,"BAN");
    }
    else return Error(playerid, 6);
    return 1;
}
pawn Код:
CMD:kick(playerid, params[])
{
    new string[128], str[156], id, reason[128];
    CL(playerid);
    if(pInfo[playerid][Admin] >= 1)
    {
        if(sscanf(params, "uS(No Reason)[128]", id, reason))
        {
            SendClientMessage(playerid, COLOR_RED, "USAGE: /kick [playerid] [reason]");
            SendClientMessage(playerid, COLOR_ORANGE, "Function: Kicks specified player!");
            return 1;
        }
        if(id == INVALID_PLAYER_ID) return Error(playerid, 0);
        if(id == playerid) return Error(playerid, 1);
        if(pInfo[playerid][Admin] < pInfo[id][Admin]) return Error(playerid, 8);
        format(str, sizeof(str), "%s(%d) has been kicked by Administrator %s(%d) (Reason: %s)", GetName(id), id, GetName(playerid), playerid, reason);
        SaveIn("kicklog.txt", str);
        format(string, sizeof(string), "You kicked %s(%d) (Reason: %s)", GetName(id), id, reason);
        SendClientMessage(playerid, COLOR_RED, string);
        format(string, sizeof(string), "%s(%d) has been kicked by Administrator %s(%d) (Reason: %s)", GetName(id), id, GetName(playerid), playerid, reason);
        SendClientMessageToAll(COLOR_GREY, string);
        format(string, sizeof(string), "You have been kicked by Administrator %s(%d) (Reason: %s)", GetName(playerid), playerid, reason);
        SendClientMessage(id, COLOR_RED, string);
        pInfo[id][Kicks] += 1;
        KickTimer[id] = SetTimerEx("KickPlayer", 500, false, "d", id);
        SendCommandToAdmins(playerid,"KICK");
    }
    else return Error(playerid, 3);
    return 1;
}
Reply
#5

In the /ban command, format a string with the information such as name, ip, admin who banned the player, date or whatever you want. Then save the information with your ban system and use ShowPlayerDialog to show the dialog to the banned player. After, set a SetTimerEx in 500 milliseconds as an interval and finally Kick the player. It will show the dialog and they will be kicked. We do not ban players because when they will connect back, it won't show why they've been banned, but the message "You are banned from this server." instead.

If a player connects, check if he's banned with your ban system and if they are, then load the data, and do the above in order to show him the dialog with the banned information and kick him.

I hope I explained it better this time.
Reply
#6

Quote:
Originally Posted by Sliceofdeath
Посмотреть сообщение
My cmd scripts

pawn Код:
CMD:jail(playerid, params[])
{
    new str[150], id, time, reason[128];
    CL(playerid);
    if(pInfo[playerid][Admin] >= 2)
    {
        if(sscanf(params, "uiS(No Reason)[128]", id, time, reason))
        {
            SendClientMessage(playerid, COLOR_RED, "USAGE: /jail [playerid] [time] [reason]");
            SendClientMessage(playerid, COLOR_ORANGE, "Function: Jails specified player with specified time, Reason is optional!");
            return 1;
        }
        if(id == INVALID_PLAYER_ID) return Error(playerid, 0);
        if(id == playerid) return Error(playerid, 1);
        if(pInfo[playerid][Admin] < pInfo[id][Admin]) return Error(playerid, 8);
        if(pInfo[id][Jail] == 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is already in jail!");
        format(str, sizeof(str), "Administrator %s(ID:%d) has jailed %s(ID:%d) for %i minutes (Reason: %s)", GetName(playerid), playerid, GetName(id), id, time, reason);
        SendClientMessageToAll(COLOR_ORANGE, str);
        format(str, sizeof(str), "You jailed %s(ID:%d) for %i minutes (Reason: %s)", GetName(id), id, time, reason);
        SendClientMessage(playerid, COLOR_YELLOW, str);
        format(str, sizeof(str), "Administrator %s(ID:%d) has jailed you for %i minutes (Reason: %s)", GetName(playerid), playerid, time, reason);
        SendClientMessage(id, COLOR_RED, str);
        pInfo[id][JailTime] = time;
        SetTimerEx("JailPlayer", 5000, 0, "d", id);
        SetTimerEx("Jail1", 1000, 0, "d", id);
        SendCommandToAdmins(playerid,"JAIL");
    }
    else return Error(playerid, 4);
    return 1;
}
pawn Код:
CMD:ban(playerid, params[])
{
    new string[128], str[256], id, reason[128], ip[16], File:ipF;
    CL(playerid);
    if(pInfo[playerid][Admin] >= 3)
    {
        if(sscanf(params, "uS(No Reason)[128]", id, reason))
        {
            SendClientMessage(playerid, COLOR_RED, "USAGE: /ban [playerid] [reason]");
            SendClientMessage(playerid, COLOR_ORANGE, "Function: Custom Ban the specified player! (Custom Ban is still the same as the orig ban!)");
            return 1;
        }
        if(pInfo[playerid][Admin] < pInfo[id][Admin]) return Error(playerid, 8);
        if(id == INVALID_PLAYER_ID) return Error(playerid, 0);
        if(id == playerid) return Error(playerid, 1);
        ipF = fopen("JakAdmin/Config/banip.txt", io_write);
        GetPlayerIp(id, ip, sizeof(ip));
        format(str, sizeof(str), "%s\r\n", ip);
        fwrite(ipF, str);
        fclose(ipF);
        format(str, sizeof(str), "%s(%d) has been banned by Administrator %s(ID:%d) (Reason: %s) (Ip of Player: %s)", GetName(id), id, GetName(playerid), playerid, reason, ip);
        SaveIn("banlog.txt", str);
        format(string, sizeof(string), "You banned %s(ID:%d) (Reason: %s)", GetName(id), id, reason);
        SendClientMessage(playerid, COLOR_RED, string);
        format(string, sizeof(string), "%s(ID:%d) has been banned by Administrator %s(ID:%d) (Reason: %s)", GetName(id), id, GetName(playerid), playerid, reason);
        SendClientMessageToAll(COLOR_GREY, string);
        format(string, sizeof(string), "You have been banned by Administrator %s(ID:%d) (Reason: %s)", GetName(playerid), playerid, reason);
        SendClientMessage(id, COLOR_RED, string);
        pInfo[id][Banned] = 1;
        pInfo[id][Bans] += 1;
        LoadBlackIPs();
        KickTimer[id] = SetTimerEx("KickPlayer", 500, false, "d", id);
        SendCommandToAdmins(playerid,"BAN");
    }
    else return Error(playerid, 6);
    return 1;
}
pawn Код:
CMD:kick(playerid, params[])
{
    new string[128], str[156], id, reason[128];
    CL(playerid);
    if(pInfo[playerid][Admin] >= 1)
    {
        if(sscanf(params, "uS(No Reason)[128]", id, reason))
        {
            SendClientMessage(playerid, COLOR_RED, "USAGE: /kick [playerid] [reason]");
            SendClientMessage(playerid, COLOR_ORANGE, "Function: Kicks specified player!");
            return 1;
        }
        if(id == INVALID_PLAYER_ID) return Error(playerid, 0);
        if(id == playerid) return Error(playerid, 1);
        if(pInfo[playerid][Admin] < pInfo[id][Admin]) return Error(playerid, 8);
        format(str, sizeof(str), "%s(%d) has been kicked by Administrator %s(%d) (Reason: %s)", GetName(id), id, GetName(playerid), playerid, reason);
        SaveIn("kicklog.txt", str);
        format(string, sizeof(string), "You kicked %s(%d) (Reason: %s)", GetName(id), id, reason);
        SendClientMessage(playerid, COLOR_RED, string);
        format(string, sizeof(string), "%s(%d) has been kicked by Administrator %s(%d) (Reason: %s)", GetName(id), id, GetName(playerid), playerid, reason);
        SendClientMessageToAll(COLOR_GREY, string);
        format(string, sizeof(string), "You have been kicked by Administrator %s(%d) (Reason: %s)", GetName(playerid), playerid, reason);
        SendClientMessage(id, COLOR_RED, string);
        pInfo[id][Kicks] += 1;
        KickTimer[id] = SetTimerEx("KickPlayer", 500, false, "d", id);
        SendCommandToAdmins(playerid,"KICK");
    }
    else return Error(playerid, 3);
    return 1;
}
Seems like from my script?
Reply
#7

Quote:
Originally Posted by _Jake_
Посмотреть сообщение
Seems like from my script?
Yeh i uses your admin system.

And i said "MY script" cause i mean't it like which i use.
It can be written as My script which i use but i didn't wrote cause i am lazy xD
Reply
#8

Jake - Can you make it for me please ?

Since it is your filterscript.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)