Authorised problem
#6

pawn Код:
CMD:kick(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized.");
    new
        giveplayerid,
        reason[64]
    ;
    if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
    if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
    if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && (PlayerInfo[giveplayerid][pHelper] >= 2 || PlayerInfo[giveplayerid][pAdmin] > 0) && playerid != giveplayerid)
    {
        format(string, sizeof(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));
        Kick(playerid);
        return 1;
    }
    new
        year,
        month,
        day,
        playerip[32],
        string[ 128 ]
    ;
    getdate(year, month, day);
    GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
    format(string, sizeof(string), "AdmCmd: %s (IP:%s) was kicked by %s, reason: %s (%d-%d-%d)", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason,month,day,year);
    Log("logs/kick.log", string);
    if(PlayerInfo[playerid][pAdmin] == 1) Log("logs/moderator.log", string);
    format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
    SendClientMessageToAllEx(COLOR_LIGHTRED, string);
    Kick(giveplayerid);
    return 1;
}
I don't see any message that it sends if you're not admin. Instead of that, I see that if a player is lower than level 2, he will get the message "Invalid player specified.".
Reply


Messages In This Thread
Authorised problem - by Shazwan - 11.12.2012, 01:01
Re: Authorised problem - by Zex Tan - 11.12.2012, 01:09
Re: Authorised problem - by Shazwan - 11.12.2012, 01:15
Re: Authorised problem - by Zex Tan - 11.12.2012, 01:48
Re: Authorised problem - by Shazwan - 11.12.2012, 01:50
Re: Authorised problem - by Konstantinos - 11.12.2012, 09:32

Forum Jump:


Users browsing this thread: 3 Guest(s)