SA-MP Forums Archive
Ban Command Problem, Please Help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Ban Command Problem, Please Help. (/showthread.php?tid=258836)



Ban Command Problem, Please Help. - itachi4x4 - 01.06.2011

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?



Re: Ban Command Problem, Please Help. - Snipa - 01.06.2011

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