Help with ban command
#1

Alright, so i have made a ban command, but when i type '/ban 2 test' it shows the usage and doesn't ban the player, could i have a little help with this, thank you

Код:
ACMD:ban(playerid, params[])
{
	if (pInfo[playerid][Adminlevel] < 2)return 0;
	new reason[25], string[250];
	if(sscanf(params, "ui",ID, reason))
	return SendClientMessage(playerid, red, "--- /ban <ID> <Reason> ---");
    if(ID == IPI)return SCM(playerid, red, "Player is not connected!");
    pInfo[playerid][Banned]=1;
    GetPlayerName(ID,pname,MAX_PLAYER_NAME);
    GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
    format(string, sizeof(string), "%s %s has banned %s for %s", AdminLevelName(playerid),Nam, pname, reason);
   	SendClientMessageToAll(red, string);
   	Kick(ID);
   	return 1;
}
Reply
#2

Код:
if (pInfo[playerid][Adminlevel] < 2)return 1;
new reason[128], string[250];
if(sscanf(params, "us[128]",ID, reason))
Reply
#3

pawn Код:
ACMD:ban(playerid, params[])
{
    if(pInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid, -1, "You aren't Admin Level 2");
    new reason[128], string[250];
    if(sscanf(params, "us[128]",ID, reason))
    return SendClientMessage(playerid, red, "--- /ban <ID> <Reason> ---");
    if(ID == IPI)return SCM(playerid, red, "Player is not connected!");
    pInfo[playerid][Banned]=1;
    GetPlayerName(ID,pname,MAX_PLAYER_NAME);
    GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
    format(string, sizeof(string), "%s %s has banned %s || Reason: %s", AdminLevelName(playerid),Nam, pname, reason);
    SendClientMessageToAll(red, string);
    Ban(ID);
    return 1;
}
Reply
#4

it worked thnank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)