Trouble with a command
#1

Код:
	if(strcmp(cmd,"/oban",true)==0)
	{
		if(PlayerInfo[playerid][pAdmin] >= 5)
		{
		    tmp = strtok(cmdtext,idx);
		    if(!strlen(tmp))
		    {
		        SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /oban [Players Username]");
		        return 1;
   			}

            new rcmsg[80],file[64],string9[128],otherfile[64];
			format(file, sizeof(file),"LARP/Users/%s.ini", tmp);
			if(!dini_Exists(file))
			return SendClientMessage(playerid, COLOR_LIGHTRED,"Error: account doesn't exists!");
			dini_IntSet(file, "Banned", 1);
			dini_IntSet(file, "Jailed", 1);
			dini_IntSet(file, "JailedTime", 3000);
			dini_IntSet(file, "Pending", 1);
			
			format(file, sizeof(file), "LARP/Users/Aliases/%s.txt", tmp);
			format(rcmsg, sizeof(rcmsg), "banip 1.1.1.1", dini_Get(file,"Nameip"));
			SendRconCommand(rcmsg);
			SendRconCommand("reloadbans");
			format(otherfile,sizeof(otherfile),"LARP/Users/Bans/%s.ban",dini_Get(file,"Nameip"));
			
			format(string, sizeof(string), "[ADMIN]: %s has banned [%s].", sendername,tmp);
			ABroadCast(COLOR_YELLOW,string, 5);
			format(string, sizeof(string), "* Successfuly banned [%s]", tmp);
			SendClientMessage(playerid,TEAM_GROVE_COLOR,string);
			new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string9,sizeof(string9), "(%d/%d/%d)[%d:%d:%d] %s Banned [%s]",d,m,y,h,mi,s,sendername,tmp);
			LoginLog(string9);
		}
		return 1;
	}
I've just writ out that OBAN Command, Offline Ban, It sets there banned level as 1 okay, and jailed etc. But doesn't ban there IP, can someone explain what I've done wrong?

It's supposed to create a ban file in /BANS/IP.ban
Reply
#2

Shouldn't this line:
Код:
format(rcmsg, sizeof(rcmsg), "banip 1.1.1.1", dini_Get(file,"Nameip"));
Be:
pawn Код:
format(rcmsg, sizeof(rcmsg), "banip %s", dini_Get(file,"Nameip"));
??
Reply
#3

I've put it as 1.1.1.1 as a test because it wasn't banning any file at all,

Still doesn't create a file called 1.1.1.1.ban

Troubles all round at the minute with Ravens, trying to develop a 100% working version for everybody, stable.

Anybody know a fix for this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)