offline ban
#1

how can i ban a offline user?
Reply
#2

Here.


PHP код:
CMD:oban(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < || PlayerInfo[playerid][pBanAppealer] >= 1)
    {
        
SendClientMessage(playeridCOLOR_GRAD1"You're not authorized to use that command!");
        return 
1;
    }
     if(
AdminDuty[playerid] != && PlayerInfo[playerid][pAdmin] < 6)
      {
           
SendClientMessage(playerid,COLOR_WHITE"You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
        return 
1;
    }
    new 
string[128], playername[MAX_PLAYER_NAME], reason[64];
    if(
sscanf(params"s[MAX_PLAYER_NAME]s[64]"playernamereason)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /oban [playername] [reason]");
    new 
giveplayerid ReturnUser(playername);
    if(
IsPlayerConnected(giveplayerid))
    {
        
SendClientMessage(playeridCOLOR_GRAD2"That player is online, use /ban for online players.");
    }
    else if(
doesAccountExist(playername))
    {
        
OnPlayerOfflineLogin(playername);
        if(
PlayerInfo[MAX_PLAYERS][pPermaBanned] == 1)
        {
            
SendClientMessage(playeridCOLOR_WHITE"That player is already permabanned!");
            return 
1;
        }
        if(
PlayerInfo[MAX_PLAYERS][pAdmin] >= 1)
        {
            
SendClientMessage(playeridCOLOR_WHITE"You can't ban admin accounts!");
            return 
1;
        }
        else
        {
            if(
PlayerInfo[MAX_PLAYERS][pBanned] >= 0)
            {
                
PlayerInfo[MAX_PLAYERS][pBanned] = 1;
                
AddBan(PlayerInfo[MAX_PLAYERS][pIP]);
                
OnPlayerOfflineSave(playername);
                
format(stringsizeof(string), "AdmCmd: %s (IP:%s) was offline banned by %s, reason: %s"playernamePlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid), reason);
                
Log("logs/ban.log"string);
                
format(string128"AdmCmd: %s (IP:%s) was offline banned by %s, reason: %s"playernamePlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid), reason);
                
ABroadCast(COLOR_LIGHTRED,string,2);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_WHITE"That player is already banned!");
            }
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_WHITE"That account doesn't exist.");
    }
    return 
1;

REP +1 Me if i helped you.
Reply
#3

Thank you
Reply
#4

Quote:
Originally Posted by TenTen
Посмотреть сообщение
Thank you
You`re welcome just don`t forget to (REP+1) me.
Reply
#5

Why would you use a command, instead of using your console ?

Quote:

/rcon login (pass)
/rcon ipban (IP)

Reply
#6

Quote:
Originally Posted by KillerDVX
Посмотреть сообщение
Why would you use a command, instead of using your console ?

coz its just copy - paste script from gamemode haha
Reply
#7

Quote:
Originally Posted by XBrianX
Посмотреть сообщение
You`re welcome just don`t forget to (REP+1) me.
If you're going to copy code directly out of not so public game modes and not give credit, don't insist on getting reputation in return.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)