public OnPlayerConnect(playerid)
{
new banfile[64];
format(banfile, sizeof(banfile),"SArcr/Users/Bans/%s.ban",GetPlayerIp(playerid, PlayerName(playerid), 32));
if(dini_Exists(banfile))
{
if(!strcmp(dini_Get(banfile, "BanName"), PlayerName(playerid), true))
{
new banmsg[128];
SendClientMessage(playerid, COLOR_ADMIN, "This player name has been banned from [Sarcr]");
format(banmsg, sizeof(banmsg), "Date of Ban: %s", dUser(PlayerName(playerid)).("BanDate"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
format(banmsg, sizeof(banmsg), "Time of Ban: %s", dUser(PlayerName(playerid)).("BanTime"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
format(banmsg, sizeof(banmsg), "Banned By: %s", dUser(PlayerName(playerid)).("BannedBy"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
format(banmsg, sizeof(banmsg), "Banned For: %s", dUser(PlayerName(playerid)).("BanReason"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
SendClientMessage(playerid, COLOR_ADMIN, "If you feel that this ban is a mistake, please make an appeal at www.sa-rcr.com");
Kick(playerid);
}
else
{
new banmsg[128];
SendClientMessage(playerid, COLOR_ADMIN, "This IP Address has been banned from [Sarcr]");
format(banmsg, sizeof(banmsg), "Date of Ban: %s", dUser(PlayerName(playerid)).("BanDate"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
format(banmsg, sizeof(banmsg), "Time of Ban: %s", dUser(PlayerName(playerid)).("BanTime"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
format(banmsg, sizeof(banmsg), "Banned By: %s", dUser(PlayerName(playerid)).("BannedBy"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
format(banmsg, sizeof(banmsg), "Banned For: %s", dUser(PlayerName(playerid)).("BanReason"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
SendClientMessage(playerid, COLOR_ADMIN, "If you feel that this ban is a mistake, please make an appeal at www.sa-rcr.com");
Kick(playerid);
}
}
format(banfile, sizeof(banfile), USER_FILE_PATH, PlayerName(playerid));
if(dini_Exists(banfile))
{
if(dUserINT(banfile).("Banned") == 1)
{
new banmsg[128];
SendClientMessage(playerid, COLOR_ADMIN, "This player name has been banned from [Sarcr]");
format(banmsg, sizeof(banmsg), "Date of Ban: %s", dUser(PlayerName(playerid)).("BanDate"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
format(banmsg, sizeof(banmsg), "Time of Ban: %s", dUser(PlayerName(playerid)).("BanTime"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
format(banmsg, sizeof(banmsg), "Banned By: %s", dUser(PlayerName(playerid)).("BannedBy"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
format(banmsg, sizeof(banmsg), "Banned For: %s", dUser(PlayerName(playerid)).("BanReason"));
SendClientMessage(playerid, COLOR_ADMIN, banmsg);
SendClientMessage(playerid, COLOR_ADMIN, "If you feel that this ban is a mistake, please make an appeal at www.sa-rcr.com");
Kick(playerid);
}
}
if(udb_Exists(banfile))
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has already been registered. Please login before you spawn.");
ShowLoginScreen(playerid);
}
else
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has not been registered. You must register before playing on [Sarcr].");
ShowRegisterScreen(playerid);
}
// other stuff...
return 1;
}
if(udb_Exists(banfile))
if(udb_Exists(userfile))
pawn Код:
pawn Код:
|
if(udb_Exists(PlayerName(playerid)))
{
if(dUserINT(PlayerName(playerid)).("Banned") == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "This player name has been banned from [Sarcr]");
SendClientMessage(playerid, COLOR_YELLOW, "Date of Ban: N/A");
SendClientMessage(playerid, COLOR_YELLOW, "Time of Ban: N/A");
SendClientMessage(playerid, COLOR_YELLOW, "Banned By: N/A");
SendClientMessage(playerid, COLOR_YELLOW, "Banned For: N/A");
SendClientMessage(playerid, COLOR_YELLOW, "If you feel that this is a mistake, please write an appeal at www.sa-rcr.com");
Kick(playerid);
}
SendClientMessage(playerid,COLOR_ERROR,"This player name has already been registered. Please login before you spawn.");
ShowLoginScreen(playerid);
}
else if(!udb_Exists(PlayerName(playerid)))
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has not been registered. You must register before playing on [Sarcr].");
ShowRegisterScreen(playerid);
}