[admin commands problem]
#5

pawn Код:
stock RPN(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] == '_') name[i] = ' ';
    }
    return name;
}

CMD:kick(playerid, params[])
{
    new playerb, string[128];
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
    if(sscanf(params, "us[128]", playerb, params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
    if(PlayerInfo[playerid][pAdmin] < PlayerInfo[playerb][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you."); format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", RPN(playerb), RPN(playerid), params);
    format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", RPN(playerb), RPN(playerid), params);
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    Kick(playerb);
    return 1;
}
Try this on for size it should work you need sscanf2 and zcmd
Reply


Messages In This Thread
[admin kick problem] - by basse - 30.09.2012, 00:06
Re: [admin commands problem] - by trapstar2020 - 30.09.2012, 00:10
Re: [admin commands problem] - by basse - 30.09.2012, 00:12
Re: [admin commands problem] - by trapstar2020 - 30.09.2012, 00:17
Re: [admin commands problem] - by trapstar2020 - 30.09.2012, 00:19
Re: [admin commands problem] - by basse - 30.09.2012, 00:23
Re: [admin commands problem] - by trapstar2020 - 30.09.2012, 00:38
Re: [admin commands problem] - by basse - 30.09.2012, 01:47

Forum Jump:


Users browsing this thread: 1 Guest(s)