20.06.2016, 03:27
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)
Thanks in advance
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], banreason, date[0], date[1], date[2]);
if(strcmp(banmsg[0], RPN(playerid), false, strlen(RPN(playerid))))
{
SendClientMessage(playerid, COLOR_RED, "----------- Ban Information -----------");
format(string, sizeof(string), "{42EB00}The username {FF0000}%s {42EB00}is banned from this server.", banmsg[0]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "{42EB00}You have been banned by {FF0000}%s {42EB00}for {FF0000}%s.", banmsg[1], banreason);
SendClientMessage(playerid, COLOR_WHITE, string);
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(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_WHITE, "{42EB00}If you feel that you have been banned wrongly, contact an Administrator.");
SendClientMessage(playerid, COLOR_RED, "---------------------------------------");
getdate(date[2], date[1], date[0]);
format(string, sizeof(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(file, string);
fclose(file);
SetTimerEx("DelayedKick", 100, 0, "i", playerid);
return 1;
}

