Kinda stuck at /tempban
#1

pawn Код:
COMMAND:tempban(playerid, params[])
{
    if (PlayerInfo[playerid][pAdminLevel] >=2)
    {
    new id,reason[128],name[MAX_PLAYER_NAME], hour,name2[MAX_PLAYER_NAME], string[128], string2[128];
    if (sscanf(params, "us[64]", id,hour,reason)) SendClientMessage(playerid, COLOR_GOLD, "Usage: /tempban <playerid> <hours> <reason>");
    else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "Player isn't connected!");
    else
    {
        new Hour, Minute, Second;
        gettime(Hour, Minute, Second);
        GetPlayerName(playerid, name, sizeof(name));
        GetPlayerName(id, name2, sizeof(name2));
        format(string, sizeof(string), "You were temporarily banned by administrator %s(%d) for %s (%d)hours",name,playerid,reason);
        format(string2, sizeof(string2), "%s was banned by administrator %s(%d) for %s (%d)hours",name2,name,playerid,reason);
        SendClientMessageToAll(COLOR_ORANGE,string2);
        SendClientMessage(id, COLOR_RED, string);
        PlayerInfo[playerid][pTban] = hour;
        format(reason, sizeof reason, "%s temp banned %s", name, reason);
        tempban[playerid]=1;
        BanEx(id,reason);
    }
    return 1;
    }

    return 1;
}
Can't seem to find a way to unban them because setting up a timer would be a epic fail, I don't know the next step here. I tried searching the forum for convertions to some what but nope no help at all. Can anyone help how to tempban a player like I shown above ?
Reply
#2

Quote:
Originally Posted by Da_Boss
Посмотреть сообщение
make your own ban system

banex does the same as ban but with reason.
I mean how do I set a rcon timer that is bug free and can actually unban the tempbanned player after
the period time.
Reply
#3

Quote:
Originally Posted by Hijolion
Посмотреть сообщение
I mean how do I set a rcon timer that is bug free and can actually unban the tempbanned player after
the period time.
No need to use a timer, just check when that player connects if he/she is temp banned and if its the correct time to unban if not kick.

Simples.
Reply
#4

Quote:
Originally Posted by Norn
Посмотреть сообщение
No need to use a timer, just check when that player connects if he/she is temp banned and if its the correct time to unban if not kick.

Simples.
Thanks for the advice, I never thought of that..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)