/ban command in SQLite
#2

pawn Код:
if(Bit1_Get(g_PlayerBanned, playerid) == 1) return Ban(playerid);
Have you tried that?

EDIT: Same code just optimized.
pawn Код:
CMD:ban(playerid, params[])
{
    new targetid, reason[128], name[MAX_PLAYER_NAME];
    if(Bit16_Get(g_AdminLevel, playerid) > 0) return SCM(playerid, COL_RED, "You need to be an admin to use this command!");
    if(sscanf(params, "us[128]", targetid, reason)) return SCM(playerid, COL_RED, "Usage: /ban <Playerid/Part of name> <Message>");
    if(!IsPlayerConnected(targetid)) return SCM(playerid, COL_RED, "Player is offline.");
    new string[128];
    format(string, sizeof(string), "%s has been banned from the server", GetPlayerName(targetid, name, sizeof(name)));
    SendClientMessageToAll(COL_RED, string);
    Bit1_Set(g_PlayerBanned, targetid, 1);
    Ban(targetid);
    return 1;
}
Reply


Messages In This Thread
/ban command in SQLite - by [HK]Ryder[AN] - 17.09.2012, 07:23
Re: /ban command in SQLite - by RedJohn - 17.09.2012, 07:29

Forum Jump:


Users browsing this thread: 2 Guest(s)