#1

I'm unsure about this one.

I'm going to make an admin system, but how can I make the admin kick all normal players, meaning the admins won't be kicked.

Help?
Reply
#2

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if (!IsPlayerAdmin(i)) // Change this to your admin variable, but remember to put 'i', not 'playerid'!
    {
        Kick(i);
    }
}
Reply
#3

pawn Код:
cmd(kickall, playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] < 5) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not the admin level required to do this command!");
    else
    {
        if (PlayerInfo[playerid][pAdminLevel] = 5);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pAdminLevel] < 1);
            {
                Kick(i);
            }
        }
    }
    return 1;
}
How can I make this work? :/
Reply
#4

pawn Код:
cmd(kickall, playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] < 5) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not the admin level required to do this command!");
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pAdminLevel] < 1);
            {
                Kick(i);
            }
        }
    }
    return 1;
}
Reply
#5

Try reading some tutorials on scripting before making an entire Admin Script
Reply
#6

pawn Код:
cmd(kickall, playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] < 5) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not the admin level required to do this command!");
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pAdminLevel] < 1); // this line
            {
                Kick(i);
            }
        }
    }
    return 1;
}

(1770) : error 036: empty statement


And btw, I do know some scripting, but I'm confused on this one..
Reply
#7

Remove the semicolon from that if statement. (Line 1770 - the error line)
Reply
#8

Quote:
Originally Posted by Hiitch
Посмотреть сообщение
Remove the semicolon from that if statement. (Line 1770 - the error line)
No, because it will kick all the Admins too.
Reply
#9

pawn Код:
cmd(kickall, playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] < 5) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not the admin level required to do this command!");
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pAdminLevel] == 0)
            {
                Kick(i);
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)