Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // MojeAntiBanObcházeníScript.sma
- #include <a_samp>
- new PlayerBanData[MAX_PLAYERS][2]; // [0] - IP adresa, [1] - Unikátní identifikátor účtu
- new BanList[MAX_PLAYERS][2]; // [0] - IP adresa, [1] - Unikátní identifikátor účtu
- public OnPlayerConnect(playerid)
- {
- new ip[16];
- GetPlayerIp(playerid, ip, sizeof(ip));
- new accountid[MAX_PLAYER_NAME];
- GetPlayerName(playerid, accountid, sizeof(accountid));
- // Kontrola na straně serveru při připojení
- if (IsPlayerBanned(playerid, ip, accountid)) {
- SendPlayerMessageToPlayer(playerid, COLOR_RED, "Jste zabanován. Obcházení banu není povoleno.");
- Kick(playerid);
- }
- return OnPlayerConnect(playerid);
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- // Uvolnění dat hráče po odpojení
- PlayerBanData[playerid][0] = "N/A";
- PlayerBanData[playerid][1] = "N/A";
- return OnPlayerDisconnect(playerid, reason);
- }
- public IsPlayerBanned(playerid, ip[], accountid[])
- {
- // Kontrola banlistu na základě IP adresy a unikátního identifikátoru účtu
- for (new i = 0; i < MAX_PLAYERS; i++) {
- if (BanList[i][0] == ip || BanList[i][1] == accountid) {
- return true; // Hráč je na banlistu
- }
- }
- return false; // Hráč není na banlistu
- }
- // Funkce pro přidání hráče na banlist
- public AddPlayerToBanList(playerid, ip[], accountid[])
- {
- // Přidání hráče na banlist
- BanList[playerid][0] = ip;
- BanList[playerid][1] = accountid;
- // Další kroky, např. uložení do databáze nebo aktualizace
- }
- // Další opatření můžete přidat podle potřeby
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement