/ban and /kick problem: You are not admin
#1

Hi guys! I have problem, I got /ban and /kick on my script, Im server owner and If I write /ban or /kick then I got message /kick: You are not admin. /ban: You are not admin.
How I can fix that?
PM! Some things is Translated to My language

Here is /ban:
PHP код:
if(strcmp(cmd"/ban"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
playersip[64];
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"KASUTUS: /ban [playerid/PartOfName] <reason>");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            new 
string3[256];
            if (
PlayerInfo[playerid][pAdmin] >= || IsPlayerAdmin(playerid))
            {
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        
GetPlayerIp(giveplayerid,playersip,sizeof(playersip));
                        new 
length strlen(cmdtext);
                        while ((
idx length) && (cmdtext[idx] <= ' '))
                        {
                            
idx++;
                        }
                        new 
offset idx;
                        new 
result[128];
                        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                        {
                            
result[idx offset] = cmdtext[idx];
                            
idx++;
                        }
                        
result[idx offset] = EOS;
                        if(!
strlen(result))
                        {
                               
SendClientMessage(playeridCOLOR_GRAD2"KASUTUS: /ban [playerid/PartOfName] [reason]");
                            return 
1;
                        }
                        if(
giveplayerid != playerid && Untouchable[giveplayerid]) return SendClientMessage(playeridCOLOR_GREY" Nice try dude...");
                        new 
targetlevel PlayerInfo[giveplayerid][pAdmin];
                        new 
playerlevel PlayerInfo[playerid][pAdmin];
                        if(
targetlevel playerlevel) return SendClientMessage(playeridCOLOR_GREY"[Totaalne-AC] - You can't use this command on that person!");
                        new 
ymd;
                        new 
h,mi,s;
                        
getdate(y,m,d);
                        
gettime(h,mi,s);
                        
format(string3,sizeof(string3), "(%d/%d/%d)[%d:%d:%d] %s Has been banned by %s for: %s",d,m,y,h,mi,s,giveplayer,sendername, (result));
                        
BanLog(string3);
                        
format(string3,sizeof(string3), "(%d/%d/%d)[%d:%d:%d] Banned by %s - Reason: %s",d,m,y,h,mi,s,sendername,(result));
                        
AddPunishment(giveplayeridstring3);
                        
format(string3sizeof(string3), "%s (%d), Has been Banned by Administrator %s for %s"giveplayergiveplayeridsendername, (result));
                        
SendClientMessageToAll(COLOR_NICEREDstring3);
                        
format(string3sizeof(string3), "[ADMIN]: %s Has Been Added to the Ban list by %s"playersipsendername);
                        
SendAdminMessage(COLOR_WHITEstring3);
                        
format(string3sizeof(string3), "You have Been Banned by Administrator %s for %s"sendername, (result));
                        
SendClientMessage(giveplayerid,COLOR_NICEREDstring3);
                        
SendClientMessage(giveplayerid,COLOR_BLUE"If You Feel that This has Been an Error, Report the Admin to www.totalroleplay.zxq.net/index.php");
                        
SendClientMessage(giveplayerid,COLOR_BLUE"To Get Unbanned Post an Unban Request at Our Forums www.totalroleplay.zxq.net/index.php");
                        
SendClientMessage(giveplayerid,COLOR_LIGHTRED"Don't Evade, Otherwise you wont get unbanned");
                          
SafeSetPlayerPos(giveplayerid,264.6288,77.5742,1001.0391);
                        
SafeSetPlayerInterior(giveplayerid6);
                           
PlayerInfo[giveplayerid][pJailTime] = 300;
                        
PlayerInfo[giveplayerid][pJailed] = 1;
                        
PlayerInfo[giveplayerid][pBanned] = 1;
                        
format(string3sizeof(string3), "~r~~h~Admin Ban: ~n~~r~%s",(result));
                        
GameTextForPlayer(giveplayeridstring360003);
                        
PlayerInfo[giveplayerid][pPending] = 0;
                        
//ScriptBan(giveplayerid,playerid,result);
                        
BanEx(giveplayerid/*,playerid*/,result);
                        return 
1;
                    }
                }
//not connected
            
}
            else
            {
                
format(stringsizeof(string), " %d is not an active player."giveplayerid);
                
SendClientMessage(playeridCOLOR_ORANGEstring);
            }
        }
        return 
1;
    } 
Here is /kick:
PHP код:
if(strcmp(cmd"/kick"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"KASUTUS: /kick [playerid/PartOfName] <reason>");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            if(
giveplayerid != playerid && Untouchable[giveplayerid]) return SendClientMessage(playeridCOLOR_GREY"* Sa ei saa seda selle mдngijaga teha!");
              new 
targetlevel PlayerInfo[giveplayerid][pAdmin];
            new 
playerlevel PlayerInfo[playerid][pAdmin];
            if(
targetlevel playerlevel) return SendClientMessage(playeridCOLOR_GREY"* You can not Kick People that is higher Than You!");
            if (
PlayerInfo[playerid][pAdmin] >= || IsPlayerAdmin(playerid))
            {
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        new 
length strlen(cmdtext);
                        while ((
idx length) && (cmdtext[idx] <= ' '))
                        {
                            
idx++;
                        }
                        new 
offset idx;
                        new 
result[128];
                        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                        {
                            
result[idx offset] = cmdtext[idx];
                            
idx++;
                        }
                        
result[idx offset] = EOS;
                        if(!
strlen(result))
                        {
                            new 
ymd;
                            new 
h,mi,s;
                            
getdate(y,m,d);
                            
gettime(h,mi,s);
                            
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has been kicked by %s, No Reason Given",d,m,y,h,mi,s,giveplayer,sendername);
                            
KickLog(string);
                            
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Kicked by %s - No Reason Given.",d,m,y,h,mi,s,sendername);
                            
AddPunishment(giveplayeridstring);
                            
format(stringsizeof(string), "%s (%d), Has been kicked by Administrator %s, No Reason Given"giveplayergiveplayeridsendername);
                            
SendClientMessageToAll(COLOR_NICEREDstring);
                            
format(stringsizeof(string), "You have Been Kicked by Administrator %s, No Reason Given"sendername);
                            
SendClientMessage(giveplayerid,COLOR_LIGHTBLUEstring);
                             
SafeSetPlayerPos(giveplayerid,1601.8762,-1671.9099,-40.5941);
                            
SafeSetPlayerInterior(giveplayerid0);
                            
GameTextForPlayer(giveplayerid"~r~~h~Admin Kicked: ~n~~r~No Reason Given"60003);
                            
SetTimerEx("KickOut",500,false,"i",giveplayerid);
                            return 
1;
                        }
                        new 
ymd;
                        new 
h,mi,s;
                        
getdate(y,m,d);
                        
gettime(h,mi,s);
                        
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has been kicked by %s for: %s",d,m,y,h,mi,s,giveplayer,sendername, (result));
                        
KickLog(string);
                        
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Kicked by %s - Reason: %s",d,m,y,h,mi,s,sendername,(result));
                        
AddPunishment(giveplayeridstring);
                        
format(stringsizeof(string), "%s (%d), Has been kicked by Administrator %s for: %s"giveplayergiveplayeridsendername, (result));
                        
SendClientMessageToAll(COLOR_NICEREDstring);
                        
format(stringsizeof(string), "You have Been Kicked by Administrator %s for: %s"sendername, (result));
                        
SendClientMessage(giveplayerid,COLOR_LIGHTBLUEstring);
                         
SafeSetPlayerPos(giveplayerid,1601.8762,-1671.9099,-40.5941);
                        
SafeSetPlayerInterior(giveplayerid0);
                         
format(stringsizeof(string), "~r~~h~Admin Kicked: ~n~~r~%s",(result));
                        
GameTextForPlayer(giveplayeridstring60003);
                        
SetTimerEx("KickOut",500,false,"i",giveplayerid);
                        return 
1;
                    }
                }
            }
            else
            {
                
format(stringsizeof(string), "** %d is not an active player."giveplayerid);
                
SendClientMessage(playeridCOLOR_GRAD1string);
            }
        }
        return 
1;
    } 
Reply


Messages In This Thread
/ban and /kick problem: You are not admin - by Makaak - 20.12.2013, 18:50
Re: /ban and /kick problem: You are not admin - by Zamora - 20.12.2013, 19:03
Re: /ban and /kick problem: You are not admin - by Mitchy - 20.12.2013, 19:14

Forum Jump:


Users browsing this thread: 1 Guest(s)