couple bugs on Ban System
#4

I have made some editions to the code, the problem was I used io_readwrite instead of io_append

This is my new code, but now it lets me connect with the name of the banned player (I tried connecting with the banned name)

PHP Code:
sscanf(buf"p<|>s[24]s[24]s[128]iii"banmsg[0], banmsg[1], banreasondate[0], date[1], date[2]);
            if(
strcmp(banmsg[0], RPN(playerid), falsestrlen(RPN(playerid))))
            {
                
SendClientMessage(playeridCOLOR_RED"----------- Ban Information -----------");
                
format(stringsizeof(string), "{42EB00}The username {FF0000}%s {42EB00}is banned from this server."banmsg[0]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
format(stringsizeof(string), "{42EB00}You have been banned by {FF0000}%s {42EB00}for {FF0000}%s."banmsg[1], banreason);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
format(string ,sizeof(string), "{42EB00}The date of banning is {FF0000}%i{42EB00}/{FF0000}%i{42EB00}/{FF0000}%i"date[0], date[1], date[2]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SendClientMessage(playeridCOLOR_WHITE"{42EB00}If you feel that you have been banned wrongly, contact an Administrator.");
                
SendClientMessage(playeridCOLOR_RED"---------------------------------------");
                
getdate(date[2], date[1], date[0]);
                
format(stringsizeof(string), "%s|The Server|Ban Evasion(%s)|%i|%i|%i"RPIP(playerid), RPN(playerid), date[0], date[1], date[2]);
                
fclose(file);
                
file fopen("bans.cfg"io_append);
                
fwrite(filestring);
                
fclose(file);
                
SetTimerEx("DelayedKick"1000"i"playerid);
                return 
1;
            } 
Thanks in advance
Reply


Messages In This Thread
couple bugs on Ban System - by NeXoR - 20.06.2016, 02:23
Re: couple bugs on Ban System - by [KHK]Khalid - 20.06.2016, 02:47
Re: couple bugs on Ban System - by NeXoR - 20.06.2016, 03:10
Re: couple bugs on Ban System - by NeXoR - 20.06.2016, 03:27
Re: couple bugs on Ban System - by [KHK]Khalid - 20.06.2016, 03:38
Re: couple bugs on Ban System - by NeXoR - 20.06.2016, 03:43

Forum Jump:


Users browsing this thread: 1 Guest(s)