Ban Message To Player Who Got Banned
#1

Help me please i want to give a ClientMessage To Those Players Who Banned Before ban he should get a message that he banned i tried it lots of times but still not fixed it so please help me here is the Command of the Ban

PHP код:
dcmd_ban(playerid,params[])
{
    if(
AccInfo[playerid][LoggedIn] == 1)
    {
        if(
AccInfo[playerid][Level] >= 5)
        {
            new 
Index;
            new 
tmp[256];  tmp  strtok(params,Index);
            new 
tmp2[256]; tmp2 strtok(params,Index);
            
            if(!
strlen(params)) return
            
SendClientMessage(playeridCOLOR_ADMIN"Usage: /ban [PlayerID] [Reason]") &&
            
SendClientMessage(playeridorange"Function: Will Ban the specified player");
            if(!
strlen(tmp2))
            return 
SendClientMessage(playeridred"ERROR: Reason unspecified!");
            new 
player1;
            new 
string[128];
            new 
playername[MAX_PLAYER_NAME];
             new 
adminname [MAX_PLAYER_NAME];
            
player1 strval(tmp);
             if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
            {
                
GetPlayerName(player1playernamesizeof(playername));
                
GetPlayerName(playeridadminnamesizeof(adminname));
                new 
year,month,daygetdate(yearmonthday);
                new 
hour,minuite,secondgettime(hour,minuite,second);
                
SendCommandToAdmins(playerid,"Ban");
                
format(string,sizeof(string),"ADMIN BAN: %s: Has Been Banned From The Server .Reason: (%s) [Date: %d/%d/%d] [Time: %d:%d]",playername,params[2],day,month,year,hour,minuite);
                
SendClientMessageToAll(COLOR_ADMIN,string);
                new 
str[128];
                
format(str,sizeof(str),"ADMIN BAN: %s: Has Been Banned From The Server .Reason: (%s)",playername,params[2]);
                
SaveIn("BanLog",str);
                print(string);
                if(
udb_Exists(PlayerName2(player1)) && AccInfo[player1][LoggedIn] == 1)
                
dUserSetINT(PlayerName2(player1)).("Banned",1);
                
format(string,sizeof(string),"Banned By Administrator %s: Reason: (%s)",adminname,params[2]);
                return 
BanEx(player1string);
            }
            else return 
SendClientMessage(playeridred"ERRPR: Player is not connected or is yourself or is the highest level admin");
        }
        else return 
ErrorMessages(playerid1);
    }
    else return 
SendClientMessage(playerid,red,"Invalid Command! Use /cmds To See The General Commands.");

Reply


Messages In This Thread
Ban Message To Player Who Got Banned - by MaxJohnson - 16.07.2015, 16:25
Re: Ban Message To Player Who Got Banned - by zPain - 16.07.2015, 16:28
Re: Ban Message To Player Who Got Banned - by MaxJohnson - 16.07.2015, 16:35
Re: Ban Message To Player Who Got Banned - by zPain - 16.07.2015, 16:41
Re: Ban Message To Player Who Got Banned - by MaxJohnson - 16.07.2015, 16:42
Re: Ban Message To Player Who Got Banned - by zPain - 16.07.2015, 16:43
Re: Ban Message To Player Who Got Banned - by MaxJohnson - 16.07.2015, 17:07
Re: Ban Message To Player Who Got Banned - by Abagail - 16.07.2015, 17:08
Re: Ban Message To Player Who Got Banned - by Sithis - 16.07.2015, 17:18
Re: Ban Message To Player Who Got Banned - by liquor - 16.07.2015, 17:53

Forum Jump:


Users browsing this thread: 2 Guest(s)