Ban Command Problem, Please Help.
#1

pawn Код:
COMMAND:ban(playerid, params[])
{
    new IsAdmin;
    IsAdmin = PlayerInfo[playerid][pAdminLevel];
    if(IsAdmin >= 2)
    {
        new string[128];
        new target, reason[128];
        if (sscanf(params, "us[128]", target, reason)) return SendClientMessage(playerid,0xFFFFFFFF, "Incomplete input");
        if(IsPlayerConnected(target))
        {
            format(string, 128, "You have banned %u for %s",target,reason); // we format it
            SendClientMessage(playerid, 0xFFFFFFFF, string); // and we send the string
            BanEx(target, reason);
        }
        else
        {
            SendClientMessage(playerid, 0xFFFFFFFF, "The target is not connected");
        }
    }
    else
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "You are not an Admin.");
        return 1;
    }
    return 1;
}
This is my command. The problem is, when i type /ban 0 Testing (example) ingame, it types "You have banned u for "
It doesnt show the string and the name.. Help please?
Reply
#2

You don't use u.. use %s and use new name[24]; GetPlayerName(targetid,name,24);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)