Need some help with temp ban(please see my code...
#8

Does the full code execute?

Do you see the last SendClientMessage in this code?
pawn Код:
CMD:tempban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 5)
    {
        new id, reason[128], aName[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
        new days, year, month, day, hour, minute;

        if(sscanf(params, "uis[250]", id, days, reason)) return SendClientMessage(playerid, -1, "{F70505}Usage: {FFFFFF}/tempban <playerid> <days> <reason>");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Invalid player ID.");

        GetPlayerName(playerid, aName, sizeof(aName));
        GetPlayerName(id, pName, sizeof(pName));
        PlayerInfo[id][pBanT] = (gettime() + (86400*days));
        getdate(year, month, day);
        gettime(hour, minute);

        new tBans[256], echo[256], banmsg[128];
        format(tBans, sizeof(tBans), "** %s (%d) has been temporarily banned by Admin %s (%d) for %d days | Reason: %s (%02d/%02d/%04d | %02d:%02d)", pName, id, aName, playerid, days, reason, day, month, year, hour, minute);
        format(banmsg, sizeof(banmsg), "Admin %s (%d) has temp banned you for %d days | Reason: %s", aName, playerid, days, reason);
        SendClientMessageToAll(COLOR_RED, tBans);
        SendClientMessage(id, COLOR_RED, banmsg);
        SetTimerEx("KickPlayer", 100, false, "i", id);
        SendClientMessage(playerid, COLOR_RED, "Should have kicked by now..");
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)