ZCMD Problem
#3

pawn Код:
COMMAND:kick(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new targetid, reason[64];
        if(!sscanf(params, "us", targetid, reason))
        {
            if(targetid != INVALID_PLAYER_ID)
            {
                if(PlayerInfo[playerid][pAdmin] != PlayerInfo[targetid][pAdmin])
                {
                    new str[128], aLVL[MAX_PLAYERS];
                    aLVL = GetAdminLvlName(playerid);
                    format(str, sizeof(str), "AdmCmd: {FF9900}%s {FFFF00}%s %s {ff6347}has kicked {FFFF00}%s %s, {ff6347}Reason: %s", aLVL, GetPlayerFirstName(playerid), GetPlayerLastName(playerid), GetPlayerFirstName(targetid), GetPlayerLastName(targetid), reason);
                    SendClientMessageToAll(0xff6347FF, str);
                    Kick(targetid);
                }
                else return SendClientMessage(playerid, COLOR_GREY, "You cannot ban administrators who are equal or superior than yourself, you have recieved a warning for this action!");
            }
            else return SendClientMessage(playerid, COLOR_GREY, "That player is not connected!");
        }
        else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [Playerid/PartOfName] [Reason]");
    }
    else return SendClientMessage(playerid, COLOR_GREY, ".:: You are not authorized to use this command ::.");
    return 1;
}
pawn Код:
stock GetAdminLvlName(playerid)
{
    new str[64];
    if (PlayerInfo[playerid][pAdmin] == 0) str = ("None");
    if (PlayerInfo[playerid][pAdmin] == 1) str = ("Moderator");
    if (PlayerInfo[playerid][pAdmin] == 2) str = ("Junior Admin");
    if (PlayerInfo[playerid][pAdmin] == 3) str = ("General Admin");
    if (PlayerInfo[playerid][pAdmin] == 4) str = ("Senior Admin I");
    if (PlayerInfo[playerid][pAdmin] == 5) str = ("Senior Admin II");
    if (PlayerInfo[playerid][pAdmin] == 1337) str = ("Head Administrator");
    if (PlayerInfo[playerid][pAdmin] == 1338) str = ("Server Manager");
    if (PlayerInfo[playerid][pAdmin] == 99999) str = ("Community Owner");
    return str;
}
Reply


Messages In This Thread
ZCMD Problem - by Alexis1999 - 20.07.2012, 21:15
Re: ZCMD Problem - by ViniBorn - 20.07.2012, 22:31
Re : ZCMD Problem - by Sandiel - 21.07.2012, 00:48

Forum Jump:


Users browsing this thread: 1 Guest(s)