HELP! kick/ban reason is not showing up
#5

Really Thanks For Answer My Question
Any Way We Need Good Scripters

PHP код:
CMD:kick(playeridparams[])
{
    if (
PlayerInfo[playerid][pAdmin] >= 1)
    {
        new 
string[128], giveplayeridreason[64];
        if(
sscanf(params"us[64]"giveplayeridreason)) return SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /kick [playerid] [reason]");
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && (PlayerInfo[giveplayerid][pHelper] >= || PlayerInfo[giveplayerid][pAdmin] > 0) && playerid != giveplayerid)
            {
                
format(stringsizeof(string), "ADMCMD: %s has been auto-kicked, reason: Trying to /kick a higher admin."GetPlayerNameEx(playerid));
                
ABroadCast(COLOR_YELLOW,string, (PlayerInfo[playerid][pAdmin] == 1) ? (1) : (2));
                
SetTimerEx("KickPlayer"500false "i"playerid); 
                return 
1;
            }
   else
            {
                new 
yearmonth,day;
                
getdate(yearmonthday);
                new 
playerip[32];
                
GetPlayerIp(giveplayeridplayeripsizeof(playerip));
                
format(stringsizeof(string), "ADMCMD: %s (IP:%s) has been kicked by %s, reason: %s (%d-%d-%d)"GetPlayerNameEx(giveplayerid), playeripGetPlayerNameEx(playerid), reason,month,day,year);
                
format(stringsizeof(string), "ADMCMD: %s has been kicked by %s, reason: %s"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
                
SendClientMessageToAllEx(COLOR_LIGHTREDstring);
                   
SetTimerEx("KickPlayer"500false "i"playerid); 
            }
            return 
1;
        }
    }
    else 
SendClientMessageEx(playeridCOLOR_GRAD1"You are not authorized to use that command!");
    return 
1;
}
CMD:skick(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 1)
    {
        new 
string[128], giveplayeridreason[64];
        if(
sscanf(params"us[64]"giveplayeridreason)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /skick [playerid/partofname] [reason]");
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
PlayerInfo[giveplayerid][pAdmin] < PlayerInfo[playerid][pAdmin]) {
                new 
playerip[32];
                
GetPlayerIp(giveplayeridplayeripsizeof(playerip));
                
format(stringsizeof(string), "AdmCmd: %s(IP:%s) was silent kicked by %s, reason: %s"GetPlayerNameEx(giveplayerid), playeripGetPlayerNameEx(playerid), reason);
                
Log("logs/kick.log"string);
                
format(stringsizeof(string), "AdmCmd: %s was silent kicked by %s, reason: %s"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
                
ABroadCast(COLOR_LIGHTRED,string,1);
                
SetTimerEx("KickPlayer"500false "i"giveplayerid); 
            }
            return 
1;
        } else 
SendClientMessage(playeridCOLOR_GRAD1"Invalid player specified.");
    }
    return 
1;
}
CMD:ban(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 2)
    {
        new 
string[128], giveplayeridreason[64];
        if(
sscanf(params"us[64]"giveplayeridreason)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /ban [playerid/partofname] [reason]");
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
            {
                if(
AdminDuty[playerid] == 1)
                {
                    new 
username[MAX_PLAYER_NAME];
                    
GetPVarString(playerid"TempNameName"usernamesizeof(username));
                    
SetPVarInt(playerid"TempName"0);
                    
SetPlayerName(playeridusername);
                }
                
format(stringsizeof(string), "AdmCmd: %s has been auto-banned, reason: Trying to /ban a higher admin."PlayerInfo[playerid][pAdminName]);
                
ABroadCast(COLOR_YELLOW,string,1);
                
PlayerInfo[playerid][pBanned] = 1;
                new 
ip[32];
                
GetPlayerIp(playerid,ip,sizeof(ip));
                
AddBan(ip);
                
SetTimerEx("KickPlayer"500false "i"playerid); 
                return 
1;
            }
            else
            {
                new 
playerip[32];
                
GetPlayerIp(giveplayeridplayeripsizeof(playerip));
                if(
AdminDuty[giveplayerid] == 1)
                {
                    new 
username[MAX_PLAYER_NAME];
                    
GetPVarString(giveplayerid"TempNameName"usernamesizeof(username));
                    
SetPVarInt(giveplayerid"TempName"0);
                    
SetPlayerName(giveplayeridusername);
                    
format(stringsizeof(string), "AdmCmd: %s(IP:%s) was banned by %s, reason: %s"PlayerInfo[giveplayerid][pAdminName], playeripGetPlayerNameEx(playerid), reason);
                    
Log("logs/ban.log"string);
                    
format(stringsizeof(string), "AdmCmd: %s was banned by %s, reason: %s"PlayerInfo[giveplayerid][pAdminName], GetPlayerNameEx(playerid), reason);
                }
                else
                {
                    
format(stringsizeof(string), "AdmCmd: %s(IP:%s) was banned by %s, reason: %s"GetPlayerNameEx(giveplayerid), playeripGetPlayerNameEx(playerid), reason);
                    
Log("logs/ban.log"string);
                    
format(stringsizeof(string), "AdmCmd: %s was banned by %s, reason: %s"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
                }
                
SendClientMessageToAllEx(COLOR_LIGHTREDstring);
                
PlayerInfo[giveplayerid][pBanned] = 1;
                new 
ip[32];
                
GetPlayerIp(giveplayerid,ip,sizeof(ip));
                
AddBan(ip);
                
SetTimerEx("KickPlayer"500false "i"giveplayerid); 
                return 
1;
            }
        } else 
SendClientMessage(playeridCOLOR_GRAD1"Invalid player specified.");
    }
    return 
1;
}
forward KickPlayer(playerid);
public 
KickPlayer(playerid)
{
       
Kick(playerid);

replace it
Reply


Messages In This Thread
HELP! kick/ban reason is not showing up - by ChristianIvann09 - 09.03.2014, 15:51
Re: HELP! kick/ban reason is not showing up - by amirab - 09.03.2014, 15:53
Re: HELP! kick/ban reason is not showing up - by 1fret - 09.03.2014, 15:53
Re: HELP! kick/ban reason is not showing up - by ChristianIvann09 - 09.03.2014, 15:56
Re: HELP! kick/ban reason is not showing up - by amirab - 09.03.2014, 16:01
Re: HELP! kick/ban reason is not showing up - by ChristianIvann09 - 09.03.2014, 16:01
Re: HELP! kick/ban reason is not showing up - by amirab - 09.03.2014, 16:03
Re: HELP! kick/ban reason is not showing up - by 1fret - 09.03.2014, 16:04
Re: HELP! kick/ban reason is not showing up - by Guest4390857394857 - 09.03.2014, 16:04
Re: HELP! kick/ban reason is not showing up - by ChristianIvann09 - 09.03.2014, 16:06

Forum Jump:


Users browsing this thread: 2 Guest(s)