Szerző Téma: Permanent ban  (Megtekintve 1099 alkalommal)

Permanent ban
« Dátum: 2012. Július 09. - 12:21:41 »
0 Show voters
Sziasztok. Egy olyan BAN rendszert szeretnek kerni, ami egy playert orokre kitilt, vagyis ha dinamikus az IPja akkor se tudjon visszajonni.
Kb. ugy gondoltam el, hogy azt az IPjat nezze meg amit a szamitogep ad nem amit a szolgatato es azt bannolja :D
Koszi elore is a segitseget.

Nem elérhető tudvari

  • 1264
  • Fejlesztő
    • Profil megtekintése
Permanent ban
« Válasz #1 Dátum: 2012. Július 09. - 12:23:50 »
0 Show voters
Mac code-ot nem lehet lekérni valahogy?Mert az mindent megoldana.

Nem elérhető Benceee

  • 4785
    • Profil megtekintése
Permanent ban
« Válasz #2 Dátum: 2012. Július 09. - 12:28:07 »
0 Show voters
Gugliztam már elég sokat. Nem nagyon.

Permanent ban
« Válasz #3 Dátum: 2012. Július 09. - 12:29:02 »
0 Show voters
Én kaptam egy módba lehet át kell írni kicsit:
 
COMMAND:rangeban(playerid, params[])
{
// Setup local variables
new PlayerToBan, PlayerIP[16], FirstPartsOfIP[16], BanCmd[24], Reason[128], Msg[128], Name[24], AdminName[24];
 
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player\'s admin-level is at least 3
if (APlayerData[playerid][PlayerLevel] >= 3)
{
   if (sscanf(params, \"us[128]\", PlayerToBan, Reason))
      SendClientMessage(playerid, 0xFF0000AA, \"Usage: \\\"/rangeban <PlayerToBan> <Reason>\\\"\");
   else
   {
      if (IsPlayerConnected(PlayerToBan))
      {
         // Get the names of the player and the admin who executed the ban
         GetPlayerName(playerid, AdminName, sizeof(AdminName));
         GetPlayerName(PlayerToBan, Name, sizeof(Name));
         // Get the player\'s IP-address
         GetPlayerIp(PlayerToBan, PlayerIP, 16);
         // Inform the player about his ban
         format(Msg, 128, \"{FF0000}You have been ip-range-banned permanently by {FFFF00}%s\", AdminName);
         SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);
         format(Msg, 128, \"{FF0000}Reason: {FFFF00}%s\", Reason);
         SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);
         // Get the first three digits from the player\'s ip, so the fourth part can be added from 0 to 255
         FirstPartsOfIP = GetFirstThreeDigitsFromIP(PlayerIP);
         // Ban the entire range of IP-addresses of the player
         for (new i; i < 256; i++)
         {
             format(BanCmd, 24, \"banip %s%i\", FirstPartsOfIP, i); // Construct the RCon command to ban every IP
                        SendRconCommand(BanCmd); // Execute the command
         }
         // Finally kick the player (the RCon command doesn\'t kick you out automatically)
         Kick(PlayerToBan);
         // Inform everybody else which player was ip-range-banned
         format(Msg, 128, \"{808080}%s %s has ip-range-banned {FFFF00}%s\", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name);
         SendClientMessageToAll(0xFFFFFFFF, Msg);
      }
   }
}
else
    return 0;
}
else
    return 0;
return 1;
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal