Ban Command
#10

Thank you that all works awesome! However now my ban command isn't working. It bans the player but it doesn't save in the database.

PHP код:
CMD:ban(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] <= 1) return 0;
    {
         new 
IDreason[128], str[128], plrIP[16], query[1024], bannedby[50];
         if(
sscanf(params"us[100]"IDreason)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /ban [PlayerID] [Reason]");
        if(
PlayerInfo[ID][pAdmin] >= PlayerInfo[playerid][pAdmin] && PlayerInfo[ID][pUCAdmin] == && PlayerInfo[playerid][pAdmin] != 6) return SendClientFormattedMessage(playeridCOLOR_RED"Error: Not enough privilages to ban %s."GetName(ID), "");
        if(!
IsPlayerConnected(ID)) return SendClientMessage(playeridCOLOR_GREY"Error: That player is not found.");
        
format(strsizeof(str), "[Admin Log]: %s has been banned by Administrator %s. [Reason: %s]"GetName(ID), GetName(playerid), reason);
        
ABroadCast(COLOR_ADMINstr1);
        print(
str);
        
GetPlayerIp(IDplrIPsizeof(plrIP));
        
SaveToFile("BanLog"str);
        
SendClientMessage(ID,COLOR_RED,"|___________[BAN INFO]___________|");
        
format(strsizeof(str), "Your name: %s.",GetName(ID));
        
SendClientMessage(IDCOLOR_REDstr);
        
format(strsizeof(str), "Your ip is: %s."plrIP);
        
SendClientMessage(IDCOLOR_REDstr);
        
format(strsizeof(str), "You were banned by: %s.",GetName(playerid));
        
SendClientMessage(IDCOLOR_REDstr);
        
format(strsizeof(str), "You were banned for: %s. Make an ban appeal on: www.vexed-rp.com",reason);
        
SendClientMessage(IDCOLOR_REDstr);
        
SendClientMessage(ID,COLOR_RED,"|___________[BAN INFO]___________|");
        
SetTimerEx("UnsetBan"5000"i"ID);
        
bannedby GetName(playerid);
        
PlayerInfo[ID][pBanned] = 1;
        
PlayerInfo[ID][pReason] = reason;
        
PlayerInfo[ID][pBannedBy] = bannedby;
        
mysql_format(ServerMySQLquerysizeof(query), "UPDATE `Users` SET pBanned = %d, pBannedBy = '%s', pReason = '%s', WHERE Name='%s'",1,GetName(playerid),reasonGetName(ID));
        
mysql_tquery(ServerMySQLquery"""");
    }
    return 
1;

Reply


Messages In This Thread
Ban Command - by Tass007 - 24.09.2016, 08:06
Re: Ban Command - by X337 - 24.09.2016, 08:54
Re: Ban Command - by Konstantinos - 24.09.2016, 09:01
Re: Ban Command - by Tass007 - 24.09.2016, 09:23
Re: Ban Command - by X337 - 24.09.2016, 09:28
Re: Ban Command - by Tass007 - 24.09.2016, 09:34
Re: Ban Command - by X337 - 24.09.2016, 09:35
Re: Ban Command - by Tass007 - 24.09.2016, 09:40
Re: Ban Command - by X337 - 24.09.2016, 10:12
Re: Ban Command - by Tass007 - 24.09.2016, 11:00

Forum Jump:


Users browsing this thread: 5 Guest(s)