Small problem with /ban cmd.
#3

Quote:
Originally Posted by ChandraLouis
Посмотреть сообщение
Try this
pawn Код:
CMD:ban(playerid,params[])
{
    if(APlayerData[playerid][LoggedIn] == true && APlayerData[playerid][PlayerLevel] >=3)
    {
        new PID;
        new reason[64];
        new str[128];
        new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Adminname, sizeof(Adminname));
        GetPlayerName(PID, Playername, sizeof(Playername));
        if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_WHITE, "{FF0000}[USAGE]: {FFFFFF} /ban [playerid] [reason]");
        if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_WHITE, "{FF0000}[ERROR]: {FFFFFF}Player is not connected!");
        format(str, sizeof(str), "[BANNED] Player '%s' has been banned by Administrator '%s'. Reason: %s ", Playername, Adminname, reason);
        SendClientMessageToAll(COLOR_RED, str);
        Ban(PID);
        return 1;
    }
    else return SendClientMessage(playerid,-1,"{FF0000}[ADMIN] Your level is not high enough {FFFFFF}[Level 3]!");
}
It works but the problem is, i also have /unban cmd ingame to unban a player. And using Ban(playerid); function saves the ban to samp.ban which i always need to unban a player by deleting the saved ban on samp.ban. Thats why i created my own file saving system for banned players. I just need to know if there is any mistakes with my timer.
Reply


Messages In This Thread
Small problem with /ban cmd. - by iOxide - 19.03.2014, 10:29
Re: Small problem with /ban cmd. - by ChandraLouis - 19.03.2014, 10:35
Re: Small problem with /ban cmd. - by iOxide - 19.03.2014, 10:39
Re: Small problem with /ban cmd. - by ChandraLouis - 19.03.2014, 10:52
Re: Small problem with /ban cmd. - by ACI - 19.03.2014, 10:56

Forum Jump:


Users browsing this thread: 1 Guest(s)