SA-MP Forums Archive
Help with ban command - 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)
+--- Thread: Help with ban command (/showthread.php?tid=546584)



Help with ban command - LeXuZ - 16.11.2014

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;
}



Re : Help with ban command - Dutheil - 16.11.2014

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



Re: Help with ban command - HY - 16.11.2014

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;
}



Re: Help with ban command - LeXuZ - 16.11.2014

it worked thnank you