/rban ain't working right
#1

hey guys after my previous topic i used this Script piece:
Код:
CMD:rban ( playerid, params[ ] )
{
	if ( P_DATA[ playerid ][ Level ] >=4 )
	{
	    new Player;
	    new ip[128];
	    new ip1[128];
		if ( sscanf ( params, "u", Player ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/rban [PlayerID]" );
		
		if ( IsPlayerConnected( Player ) )
		{
		    new year,month,day; getdate(year, month, day);
                    new hour,minuite,second; gettime(hour,minuite,second);
                    new File:Bans=fopen("BanLog.txt", io_append);
		    FormatMSG( playerid, ABLUE, "|- You Have Banned %s [Date: %d/%d/%d] [Time: %d,%d] -|", PlayerName2 ( Player ), day, month, year, hour, minuite);
		    FormatMSG( Player, ABLUE, "|- You Have Been Banned By %s [Date: %d/%d/%d] [Time: %d,%d] -|", PlayerName2 ( playerid ), day, month, year, hour, minuite);
		    new str[128];
		    format(str,sizeof(str),"%s has been Range Banned by Administrator %s | [Date: %d/%d/%d] [Time: %d,%d]",PlayerName2 ( Player ) ,PlayerName2 ( playerid ), day, month, year, hour, minuite);
		    fwrite(Bans, str);
		    print(str);
		    GetPlayerIp(Player, ip1, sizeof(ip1));
                    format(ip,128,"%s**",ip);
                    fwrite(Bans, ip);
                    format(ip1,128,"banip %s",ip1);
                    SendRconCommand(ip1);
                    fclose(Bans);
		}
		else return SendClientMessage( playerid, RED, "ERROR: Player Is Not Online!" );
	}
	else return SendaLevel ( playerid, 4 );
	return 1;
}
but when i type the command ingame nothing happens any ideas why?

Apart from that thanks

Regards,
Zon.

I Would Also Like to note: it compiles with no errors and the other cmds work fine just not this cmd
Reply
#2

Try replacing
Код:
GetPlayerIp(Player, ip1, sizeof(ip1));
format(ip,128,"%s**",ip);
fwrite(Bans, ip);
format(ip1,128,"banip %s",ip1);
with
Код:
GetPlayerIp(Player, ip1, sizeof(ip1));
strdel( ip1, strlen( ip1 ) - 2, strlen( ip1 ) );
strcat( ip1, "**", 128 );
fwrite(Bans, ip);
format(ip1,128,"banip %s",ip1);
Reply
#3

still not working its the command itself not inside it, it always returns this
Код:
else return SendClientMessage( playerid, RED, "ERROR: You need to be Admin Level 4 or bigest to use this command!" );
Code like it returns you have to be a certain lvl even when i am the level it says i need to be to use it but my other cmds are fine
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)