20.07.2011, 20:14
When I try to login to my server now it will send me a message and then nothing will happen after that, it will just stay that way. I've concluded that the problem is under OnPlayerConnect but the problem is I'm not sure what to do to fix it. Here's the code that I believe is responsible for this strange error.
I will be adding some screens soon...
pawn Code:
public OnPlayerConnect(playerid)
{
new banfile[64], ipstring[32], string[128];
SendClientMessage(playerid, COLOR_DEADCONNECT, "|_Ban Check Started_|");
SendClientMessage(playerid, COLOR_YELLOW, "Checking for bans...");
GetPlayerIp(playerid, ipstring, sizeof(ipstring));
format(banfile, sizeof(banfile),"SArcr/Users/Bans/%s.ban", ipstring);
if(DOF2_FileExists(banfile)) {
new banmsg[128];
if(!strcmp(DOF2_GetString(banfile, "BanName"), PlayerName(playerid), true)) {
SendClientMessage(playerid, COLOR_YELLOW, "====================================BANNED=====================================");
SendClientMessage(playerid, COLOR_YELLOW, "This player name has been banned from [Sarcr]");
format(banmsg, sizeof(banmsg), "Date of Ban: %s", dUser(PlayerName(playerid)).("BanDate"));
SendClientMessage(playerid, COLOR_YELLOW, banmsg);
format(banmsg, sizeof(banmsg), "Time of Ban: %s", dUser(PlayerName(playerid)).("BanTime"));
SendClientMessage(playerid, COLOR_YELLOW, banmsg);
format(banmsg, sizeof(banmsg), "Banned By: %s", dUser(PlayerName(playerid)).("BannedBy"));
SendClientMessage(playerid, COLOR_YELLOW, banmsg);
format(banmsg, sizeof(banmsg), "Banned For: %s", dUser(PlayerName(playerid)).("BanReason"));
SendClientMessage(playerid, COLOR_YELLOW, banmsg);
SendClientMessage(playerid, COLOR_YELLOW, "If you feel that this ban is a mistake, please make an appeal at www.sa-rcr.com");
SendClientMessage(playerid, COLOR_YELLOW, "===============================================================================");
Kick(playerid);
}
else {
SendClientMessage(playerid, COLOR_YELLOW, "====================================BANNED=====================================");
SendClientMessage(playerid, COLOR_YELLOW, "This IP Address has been banned from [Sarcr]");
format(banmsg, sizeof(banmsg), "Date of Ban: %s", dUser(PlayerName(playerid)).("BanDate"));
SendClientMessage(playerid, COLOR_YELLOW, banmsg);
format(banmsg, sizeof(banmsg), "Time of Ban: %s", dUser(PlayerName(playerid)).("BanTime"));
SendClientMessage(playerid, COLOR_YELLOW, banmsg);
format(banmsg, sizeof(banmsg), "Banned By: %s", dUser(PlayerName(playerid)).("BannedBy"));
SendClientMessage(playerid, COLOR_YELLOW, banmsg);
format(banmsg, sizeof(banmsg), "Banned For: %s", dUser(PlayerName(playerid)).("BanReason"));
SendClientMessage(playerid, COLOR_YELLOW, banmsg);
SendClientMessage(playerid, COLOR_YELLOW, "If you feel that this ban is a mistake, please make an appeal at www.sa-rcr.com");
SendClientMessage(playerid, COLOR_YELLOW, "===============================================================================");
Kick(playerid);
}
return 1;
}
if(udb_Exists(PlayerName(playerid))) {
if(dUserINT(PlayerName(playerid)).("Banned") == 1) {
SendClientMessage(playerid, COLOR_YELLOW, "====================================BANNED=====================================");
SendClientMessage(playerid, COLOR_YELLOW, "This player name has been banned from [Sarcr]");
SendClientMessage(playerid, COLOR_YELLOW, "The data regarding this ban is unavailable.");
SendClientMessage(playerid, COLOR_YELLOW, "If you feel that this is a mistake, please write an appeal at www.sa-rcr.com");
SendClientMessage(playerid, COLOR_YELLOW, "===============================================================================");
Kick(playerid);
}
ShowLoginScreen(playerid);
}
else if(!udb_Exists(PlayerName(playerid))) {
ShowRegisterScreen(playerid);
}
SendClientMessage(playerid, COLOR_DEADCONNECT, "|_Ban Check Complete_|");
SendClientMessage(playerid, COLOR_GREEN, "No Bans were found");
// other stuff...
}