ban nick cmd help
#1

hi When i Try /bannick and i want to ban player its not DO anything even dont see a massage and the player didnt get banned

cmd bannick:
Код:
CMD:bannick(playerid,params[]) {
	if(PlayerInfo[playerid][LoggedIn] == 1) {
		if(PlayerInfo[playerid][Level] >= 2) {
        new
			string[53],nickname[50], reason[48];
        if(sscanf(params, "s[50]s[48]", nickname, reason)) return SCM(playerid, -1, "USAGE: /Bannick (Nickname) (Reason)");
        return VBanNick(playerid,nickname,reason);

		format(string,sizeof(string),"You have banned \"%s\" from the server. (Reason: %s)",nickname,reason);
                SaveToFile("BanLog",string);
                CMDMessageToAdmins(playerid,"BANNICK");
                format(string,sizeof(string),"/ladmin/bans/%s.sav", nickname);
				
		} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
	} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
VBanNick codes:
Код:
stock VBanNick(playerid,nick[],reason[])
{
    format(Vnewban,32,BanDir,nick);

    if(dini_Exists(Vnewban))
		return SendClientMessage(playerid, ErrorColor,""COL_BLUE"This username is already banned.");

	new giveid;
	giveid = VBReturnUser(nick);
	if(!IsPlayerConnected(giveid))
	{
        format(NICKBAN,20,nick);

		format(Vnewban,32,BanDir,VBPlayer(giveid));
		dini_Create(Vnewban);
	    return VBanSaveInfo(playerid,Vnewban,reason);
    }
	else
	    return VBanID(playerid,giveid,reason);
}
Reply
#2

any one help ??
Reply
#3

Help me guys
Reply
#4

it must kick the player after saving in the ban folder so that when he re-joins he is banned

try this

Код:
CMD:bannick(playerid,params[]) {
	if(PlayerInfo[playerid][LoggedIn] == 1) {
		if(PlayerInfo[playerid][Level] >= 2) {
        new
			string[53],nickname[50], reason[48];
        if(sscanf(params, "s[50]s[48]", nickname, reason)) return SCM(playerid, -1, "USAGE: /Bannick (Nickname) (Reason)");
        return VBanNick(playerid,nickname,reason);

		format(string,sizeof(string),"You have banned \"%s\" from the server. (Reason: %s)",nickname,reason);
                SaveToFile("BanLog",string);
                CMDMessageToAdmins(playerid,"BANNICK");
                format(string,sizeof(string),"/ladmin/bans/%s.sav", nickname);
                Kick(playerid);
		} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
	} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
PLZ +REP ME
Reply
#5

but when i bannick the player will not be online ( its serial ban)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)