[admin commands problem]
#1

pawn Код:
dcmd_kick(playerid,params[])
    {
    if(IsPlayerAdmin(playerid))
    {
    new ID;
    new pname[24];
    new string[200];
    new reason;
    if(sscanf(params, "uz", ID, reason)) return SendClientMessage(playerid, COLOR_RED, "Usage: /kick (ID) (REASON)");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "Invalid ID.");
    GetPlayerName(playerid, pname,24);
    GetPlayerName(ID);
    format(string, 200, "[ADMIN KICK] %S", reason);
    SendClientMessageToAll(COLOR_GREEN, string);
    format(string, 200, "[ADMIN ACTION] Admin has kicked %s(%d) %s", pname, ID, reason);
    Kick(ID);
    return 1;
    }
    return SendClientMessage(playerid, COLOR_RED, "You Are Not An Admin");
    }
Whats the problem it gets like this http://gyazo.com/32cdd3b6b9c34f405675ea303e191157
Reply
#2

ban(playerid)//ban
ummmm u need to set a jail spot//jail
kick(playerid)//kick
toggleplayercontroller//freeze

you also need to look at sscanf2 for a second player
Reply
#3

okay i might not have been clear enough i can make the commands work, its not the "reason" part that doesent work like /kick id reason so when i do

/kick 0 test it will be
admin kicked "someplayername" t(0)
Reply
#4

here iz a eg

pawn Код:
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", pname(playerb), pnameplayerid), params);
    SendClientMessageToAll(-1, string);
Reply
#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
#6

Okay how many times am i going to explain my self 1. i don't want it to type kicked "BY" admin i just want it to say

player %s was kicked "BY an admin not wich admin"

and 2. i said dcmd >.<
Reply
#7

well change it
it used the same with i think dcmd= dcmd_kick and cmd:kick iz zcmd

well just move rpn(playerid)

rpn(playerid) ==== kicker rpn(playerb) person getting kick
Reply
#8

updated the command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)