Kick command not working
#3

you add } else { for SSCANF not admin permission also if you wanna add it, its should be } else return your message ....

try:
PHP код:
CMD:kick(playeridparams[])
{
    if (
PlayerInfo[playerid][pAdmin] >= 1)
    {
        new 
target,reason[64],str[128],logstring[200],month,day,year;
        new 
Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridAdminnamesizeof(Adminname));
        
GetPlayerName(targetPlayernamesizeof(Playername));
        
getdate(yearmonthday);
        if(
sscanf(params"us[64]"target,reason)) return SCM(playeridbojaz"[INFO]: /kick [playerid] [reason]");
        if(!
IsPlayerConnected(target))
            return 
SCM(playeridbojaz"Player is not connected!");
        
format(strsizeof(str), "[Adm] %s has been kicked by '%s'. Reason: %s (%d-%d-%d) "PlayernameAdminnamereason,year,month,day);
        
printf(str);
        
format(logstringsizeof(logstring), "Info: %s was kicked by %s, reason: %s (%d-%d-%d).",sendername(target),sendername(playerid),reason,year,month,day);
        
KickLog(logstring);
        
SetTimerEx("kicktimer"1000false"d"target);
    } else return 
SCM(playerid,bojaz,"You re not admin");
    return 
1;
}
CMD:ban(playeridparams[])
{
    if (
PlayerInfo[playerid][pAdmin] >= 1)
    {
        new 
target;
        new 
reason[64];
        new 
str[128];
        new 
day,month,year;
        
getdate(yearmonthday);
        new 
Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridAdminnamesizeof(Adminname));
        
GetPlayerName(targetPlayernamesizeof(Playername));
        if(
sscanf(params"us[64]"target,reason)) return SCM(playerid, -1,"[INFO]: /ban [playerid] [reason]");
        if(!
IsPlayerConnected(target))    return SCM(playerid,bojaz"** Player not found.");
        
format(strsizeof(str), "[Adm] %s has been banned by %s. Reason: %s (%d-%d-%d) "PlayernameAdminnamereason,year,month,day);
        
SendClientMessageToAll(bojazstr);
        
printf(str);
        
BanLog(str);
        
PlayerInfo[target][pBanned] = 1;
        
SetTimerEx("bantimer"1000false"d"target);
    } else return 
SCM(playerid,bojaz,"Your not admin");
    return 
1;

dude you kiding xD?
PHP код:
if (PlayerInfo[playerid][pAdmin] >= 1) return SCM(playerid,bojaz,"Your not admin"); 
it will not let any admin that higher than or level 1 to use the command instead of it you can use:
PHP код:
if (PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,bojaz,"Your not admin"); 
Reply


Messages In This Thread
Kick command not working - by Mijata - 06.09.2015, 19:20
Re: Kick command not working - by saffierr - 06.09.2015, 19:27
Re: Kick command not working - by jlalt - 06.09.2015, 19:38
Re: Kick command not working - by Mijata - 06.09.2015, 19:45
Re: Kick command not working - by jlalt - 06.09.2015, 19:49
Re: Kick command not working - by saffierr - 06.09.2015, 19:49
Re: Kick command not working - by Mijata - 06.09.2015, 20:17
Re: Kick command not working - by jlalt - 06.09.2015, 20:43
Re: Kick command not working - by Mijata - 06.09.2015, 20:51
Re: Kick command not working - by saffierr - 06.09.2015, 20:57

Forum Jump:


Users browsing this thread: 3 Guest(s)