31.03.2014, 05:17
When i tried. To ban a player.. It bans players and IP right?
Then when a new player from other country come they saying they are banned.
I dont really know why. Even if they IP is not same in ban
Need Help please
OnPlayerConnect
Ban/Banip/oBan
Permanent Banned
THANK YOU SO MUCH FOR HELPING GUYS!
Then when a new player from other country come they saying they are banned.
I dont really know why. Even if they IP is not same in ban
Need Help please
OnPlayerConnect
Код:
new string[128]; new playerip[32]; GetPlayerIp(playerid, playerip, sizeof(playerip)); new szPlayerIP[16]; new ip[128]; GetPlayerIp(playerid, szPlayerIP, sizeof(szPlayerIP)); GetPlayerIp(playerid,ip,sizeof(ip)); if(PlayerInfo[playerid][pBanned] >= 1 || PlayerInfo[playerid][pPermaBanned] >= 1 || CheckBan(szPlayerIP) >= 1) { format(string, sizeof(string), "WARNING: %s (IP:%s) tried to login whilst banned and has been auto-banned.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pIP]); ABroadCast(COLOR_YELLOW, string, 1); AddBan(ip); Log("logs/ban.log", string); SetPlayerName(playerid, "BannedPlayer"); SendClientMessage(playerid, COLOR_REALRED, "If you are permanently banned that means you cannot appeal anymore!!!"); KickWithMessage(playerid, COLOR_REALRED, "You are banned from Philippines Roleplay. You may appeal this ban at "WEBSITE""); return 1; }
Код:
CMD:ban(playerid, params[]) { if(CheckGMX(playerid)) return 1; if(PlayerInfo[playerid][pAdmin] >= 2) { new string[128], giveplayerid, reason[64]; if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [playerid/partofname] [reason]"); if(IsPlayerConnected(giveplayerid)) { if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin]) { if(AdminDuty[playerid] == 1) { new username[MAX_PLAYER_NAME]; GetPVarString(playerid, "TempNameName", username, sizeof(username)); SetPVarInt(playerid, "TempName", 0); SetPlayerName(playerid, username); } format(string, sizeof(string), "AdmCmd: %s has been auto-banned, reason: Trying to /ban a higher admin.", PlayerInfo[playerid][pAdminName]); ABroadCast(COLOR_YELLOW,string,1); PlayerInfo[playerid][pBanned] = 1; new ip[32], cw[64], tstring[128], year, month, day, hour, minute, second; GetPlayerIp(playerid,ip,sizeof(ip)); AddBan(ip); getdate(year, month, day); gettime(hour, minute, second); format(tstring, sizeof(tstring), "Date/Time: %i/%i/%i, %i:%i:%i", day, month, year, hour, minute, second); format(cw, sizeof(cw), "Current Warnings: %i (3 for Ban)", PlayerInfo[playerid][pWarns]); ABroadCast(COLOR_LIGHTRED, string, 1); SendClientMessage(playerid, COLOR_REALRED, "--------------------- Ban Report ---------------------"); SendClientMessage(playerid, COLOR_WHITE, cw); SendClientMessage(playerid, COLOR_WHITE, "Staff: Server"); SendClientMessage(playerid, COLOR_WHITE, "Reason: Tried to ban a higher admin"); SendClientMessage(playerid, COLOR_WHITE, tstring); SendClientMessage(playerid, COLOR_REALRED, "Make sure you have the Screenshot of this ban by pressing (F8)"); SendClientMessage(playerid, COLOR_REALRED, "Feel free to post a ban appeal at "WEBSITE". Have a nice day!"); SendClientMessage(playerid, COLOR_REALRED, "-------------------------------------------------------"); KickWithMessage(playerid, COLOR_REALRED, "Your Banned from Philippines Roleplay"); return 1; } else { new playerip[32]; GetPlayerIp(giveplayerid, playerip, sizeof(playerip)); if(AdminDuty[giveplayerid] == 1) { new username[MAX_PLAYER_NAME]; GetPVarString(giveplayerid, "TempNameName", username, sizeof(username)); SetPVarInt(giveplayerid, "TempName", 0); SetPlayerName(giveplayerid, username); format(string, sizeof(string), "AdmCmd: %s(IP:%s) was banned by %s, reason: %s", GetPlayerNameEx(giveplayerid),playerip, PlayerInfo[playerid][pAdminName], reason); Log("logs/ban.log", string); format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), PlayerInfo[playerid][pAdminName], reason); } else { format(string, sizeof(string), "AdmCmd: %s(IP:%s) was banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), playerip, PlayerInfo[playerid][pAdminName], reason); Log("logs/ban.log", string); format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), PlayerInfo[playerid][pAdminName], reason); } ABroadCast(COLOR_LIGHTRED, string, 1); PlayerInfo[giveplayerid][pBanned] = 1; new ip[32]; GetPlayerIp(giveplayerid,ip,sizeof(ip)); AddBan(ip); new cw[64], tstring[128], sstring[128], rstring[128], aname[pAdminName], year, month, day, hour, minute, second; GetPlayerName(playerid, aname, sizeof(aname)); getdate(year, month, day); gettime(hour, minute, second); format(tstring, sizeof(tstring), "Date/Time: %i/%i/%i, %i:%i:%i", day, month, year, hour, minute, second); format(sstring, sizeof(sstring), "Staff: %s", PlayerInfo[playerid][pAdminName]); format(rstring, sizeof(rstring), "Reason: %s", reason); format(cw, sizeof(cw), "Current Warnings: %i (3 for Ban)", PlayerInfo[giveplayerid][pWarns]); SendClientMessage(giveplayerid, COLOR_REALRED, "--------------------- Ban Report ---------------------"); SendClientMessage(giveplayerid, COLOR_WHITE, cw); SendClientMessage(giveplayerid, COLOR_WHITE, sstring); SendClientMessage(giveplayerid, COLOR_WHITE, rstring); SendClientMessage(giveplayerid, COLOR_WHITE, tstring); SendClientMessage(giveplayerid, COLOR_REALRED, "Make sure you have the Screenshot of this ban by pressing (F8)"); KickWithMessage(giveplayerid, COLOR_REALRED, "Feel free to post a ban appeal at ["WEBSITE"]"); return 1; } } else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified."); } return 1; }
Код:
CMD:oban(playerid, params[]) { if(CheckGMX(playerid)) return 1; if(PlayerInfo[playerid][pAdmin] < 3) { SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!"); return 1; } if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6) { SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty."); return 1; } new string[128], playername[MAX_PLAYER_NAME], reason[64]; if(sscanf(params, "s[MAX_PLAYER_NAME]s[64]", playername, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oban [playername] [reason]"); new giveplayerid = ReturnUser(playername); if(IsPlayerConnected(giveplayerid)) { SendClientMessage(playerid, COLOR_GRAD2, "That player is online, use /ban for online players."); } else if(doesAccountExist(playername)) { OnPlayerOfflineLogin(playername); if(PlayerInfo[MAX_PLAYERS][pPermaBanned] == 1) { SendClientMessage(playerid, COLOR_WHITE, "That player is already permabanned!"); return 1; } if(PlayerInfo[MAX_PLAYERS][pAdmin] >= 1) { SendClientMessage(playerid, COLOR_WHITE, "You can't ban admin accounts!"); return 1; } else { if(PlayerInfo[MAX_PLAYERS][pBanned] >= 0) { PlayerInfo[MAX_PLAYERS][pBanned] = 1; AddBan(PlayerInfo[MAX_PLAYERS][pIP]); OnPlayerOfflineSave(playername); format(string, sizeof(string), "AdmCmd: %s (IP:%s) was offline banned by %s, reason: %s", playername, PlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid), reason); Log("logs/ban.log", string); format(string, 128, "AdmCmd: %s (IP:%s) was offline banned by %s, reason: %s", playername, PlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid), reason); ABroadCast(COLOR_LIGHTRED,string,1); } else { SendClientMessage(playerid, COLOR_WHITE, "That player is already banned!"); } } } else { SendClientMessage(playerid, COLOR_WHITE, "That account doesn't exist."); } return 1; }
Код:
CMD:banip(playerid, params[]) { if(CheckGMX(playerid)) return 1; if(IsPlayerConnected(playerid)) { new string[128], tmp[32]; if(sscanf(params, "s[32]", tmp)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /banip [ip]"); if(AdminDuty[playerid] == 0) return SendClientMessage(playerid, -1, "You must be ( /aduty ) to use this Command!"); if(PlayerInfo[playerid][pAdmin] >= 4) { AddBan(tmp); format(string, sizeof(string), "ADMCMD: %s has banned IP:%s", GetPlayerNameEx(playerid), tmp); ABroadCast(COLOR_LIGHTRED,string,1); } else { SendClientMessage(playerid, COLOR_GRAD2, " You are not authorized to use that command !"); } } return 1; }
Код:
CMD:permaban(playerid, params[]) { if(CheckGMX(playerid)) return 1; if(PlayerInfo[playerid][pAdmin] > 4) { new string[128], giveplayerid, reason[64]; if(sscanf(params, "us[64]", giveplayerid, reason)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /permaban [playerid/partofname] [reason]"); return 1; } if(IsPlayerConnected(giveplayerid)) { if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin]) { if(AdminDuty[playerid] == 1) { new username[MAX_PLAYER_NAME]; GetPVarString(playerid, "TempNameName", username, sizeof(username)); SetPVarInt(playerid, "TempName", 0); SetPlayerName(playerid, username); } format(string, sizeof(string), "AdmCmd: %s has been auto-banned, reason: Trying to /permaban a higher admin.", PlayerInfo[playerid][pAdminName]); ABroadCast(COLOR_YELLOW,string,1); PlayerInfo[playerid][pPermaBanned] = 1; new ip[32], cw[64], tstring[128], year, month, day, hour, minute, second; GetPlayerIp(playerid,ip,sizeof(ip)); AddBan(ip); getdate(year, month, day); gettime(hour, minute, second); format(tstring, sizeof(tstring), "Date/Time: %i/%i/%i, %i:%i:%i", day, month, year, hour, minute, second); format(cw, sizeof(cw), "Current Warnings: %i (3 for Ban)", PlayerInfo[playerid][pWarns]); ABroadCast(COLOR_LIGHTRED, string, 1); SendClientMessage(playerid, COLOR_REALRED, "--------------------- Permanent Ban Report ---------------------"); SendClientMessage(playerid, COLOR_WHITE, cw); SendClientMessage(playerid, COLOR_WHITE, "Staff: Server"); SendClientMessage(playerid, COLOR_WHITE, "Reason: Tried to ban a higher admin"); SendClientMessage(playerid, COLOR_WHITE, tstring); SendClientMessage(playerid, COLOR_REALRED, "This ban cannot be appeal anymore."); SendClientMessage(playerid, COLOR_REALRED, "Only the server owner can decide if he will unban."); SendClientMessage(playerid, COLOR_REALRED, "If you feel this ban is unfair contact Ivann at skype: christianivann09"); SendClientMessage(playerid, COLOR_REALRED, "-------------------------------------------------------"); KickWithMessage(playerid, COLOR_REALRED, "Say good bye to Philippines Roleplay Mate."); } else { new playerip[32]; GetPlayerIp(giveplayerid, playerip, sizeof(playerip)); if(AdminDuty[giveplayerid] == 1) { new username[MAX_PLAYER_NAME]; GetPVarString(giveplayerid, "TempNameName", username, sizeof(username)); SetPVarInt(giveplayerid, "TempName", 0); SetPlayerName(giveplayerid, username); format(string, sizeof(string), "AdmCmd: %s(IP:%s) was permanently banned by %s, reason: %s", PlayerInfo[giveplayerid][pAdminName], playerip, GetPlayerNameEx(playerid), reason); Log("logs/ban.log", string); format(string, sizeof(string), "AdmCmd: %s was permanently banned by %s, reason: %s", PlayerInfo[giveplayerid][pAdminName], GetPlayerNameEx(playerid), reason); } else { format(string, sizeof(string), "AdmCmd: %s(IP:%s) was permanently banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason); Log("logs/ban.log", string); format(string, sizeof(string), "AdmCmd: %s was permanently banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason); } ABroadCast(COLOR_LIGHTRED, string, 1); PlayerInfo[giveplayerid][pPermaBanned] = 1; new ip[32]; GetPlayerIp(giveplayerid,ip,sizeof(ip)); AddBan(ip); new cw[64], tstring[128], sstring[128], rstring[128], aname[pAdminName], year, month, day, hour, minute, second; GetPlayerName(playerid, aname, sizeof(aname)); getdate(year, month, day); gettime(hour, minute, second); format(tstring, sizeof(tstring), "Date/Time: %i/%i/%i, %i:%i:%i", day, month, year, hour, minute, second); format(sstring, sizeof(sstring), "Staff: %s", PlayerInfo[playerid][pAdminName]); format(rstring, sizeof(rstring), "Reason: %s", reason); format(cw, sizeof(cw), "Current Warnings: %i (3 for Ban)", PlayerInfo[giveplayerid][pWarns]); SendClientMessage(giveplayerid, COLOR_REALRED, "--------------------- PermanentBan Report ---------------------"); SendClientMessage(giveplayerid, COLOR_WHITE, cw); SendClientMessage(giveplayerid, COLOR_WHITE, sstring); SendClientMessage(giveplayerid, COLOR_WHITE, rstring); SendClientMessage(giveplayerid, COLOR_WHITE, tstring); SendClientMessage(playerid, COLOR_REALRED, "This ban cannot be appeal anymore."); SendClientMessage(playerid, COLOR_REALRED, "Only the server owner can decide if he will unban."); SendClientMessage(playerid, COLOR_REALRED, "If you feel this ban is unfair contact Ivann at skype: christianivann09"); SendClientMessage(playerid, COLOR_REALRED, "-------------------------------------------------------"); KickWithMessage(playerid, COLOR_REALRED, "Say good bye to Philippines Roleplay Mate."); } return 1; } } else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified."); return 1; }