Raised This Month: $51 Target: $400
 12% 

AMXBans install


Post New Thread Reply   
 
Thread Tools Display Modes
ScchutzZ
Junior Member
Join Date: Jan 2024
Old 01-06-2024 , 17:39   Re: AMXBans install
Reply With Quote #11

Quote:
Originally Posted by fysiks View Post
I can't seem to find anything like that in the code. I can only assume that's someone's personal customization. If you can provide a link to that site, I can take a look at it.
I managed to add it by doing it this way. If you want to add it to the source, you can add it this way, there is no problem for now, but you know better

in templates/ban_list.tpl under <div class="post">
Code:
		<span>
			{if isset($check_id)}
			<div class='error'><a href="http://{$smarty.server.HTTP_HOST}{$smarty.server.PHP_SELF}?bid={$check_id}"><span style='color:white;font-weight:bold;text-shadow: #990000 0px 0px 3px;'>{"_YOUAREBANNED"|lang}</span></a></div>
			{else}
			<div class='success'><span style='color:green;font-weight:bold;text-shadow: #00991E 0px 0px 3px;'>{"_IP"|lang} &mdash; ({$your_ip}) {"_YOUNOTBANNED"|lang}</span></div>
			{/if}
		</span>
in mainfolder/ban_list.php on top $smarty->assign("meta","");

Code:
$sql = "SELECT * FROM `" . $config->db_prefix . "_bans` WHERE player_ip = '{$_SERVER['REMOTE_ADDR']}' AND expired = 0 AND (`ban_length` = 0 OR `ban_created` + `ban_length` * 60 > " . time() . ")";
$result = mysqli_query($mysql, $sql);

if ($result) {
    $result_yes = mysqli_num_rows($result);
    if ($result_yes) {
        $user = mysqli_fetch_assoc($result);
        $bids = $user['bid'];
        $smarty->assign("check_id", $bids);
    }
    mysqli_free_result($result);
} else {
    // Handle error using mysqli_error($mysql)
}

$smarty->assign("your_ip", $_SERVER['REMOTE_ADDR']);
in language/yourlang.php

Code:
define("_YOUNOTBANNED", "Don't worry, you are not banned");
define("_YOUAREBANNED","You have been banned!!");
ScchutzZ is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-06-2024 , 18:59   Re: AMXBans install
Reply With Quote #12

Banning by IP address is completely useless because they change all the time so I'm not sure why anyone would want this.
__________________
fysiks is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 01-08-2024 , 08:38   Re: AMXBans install
Reply With Quote #13

Quote:
Originally Posted by fysiks View Post
Banning by IP address is completely useless because they change all the time so I'm not sure why anyone would want this.
Indeed, even by banning an entire IP class (255 or + IPs), people can still use a VPN and connect from almost any country they want by using random IP addresses and continue to spam/ hack. However, not everyone knows how this is done. So, the SteamID bans are the recommended ones, but still, there are users owning multiple accounts as well.
__________________

Last edited by claudiuhks; 01-08-2024 at 08:44.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Shico
Junior Member
Join Date: Feb 2018
Old 01-12-2024 , 13:01   Re: AMXBans install
Reply With Quote #14

The version AMXbans 1.6# It comes from the AMXbans version 6.0.3 version and was completely revised by amxx.pl This version has more than enough problems, I also tested it and I stick with the original code from the developer, which is also what I'm using right now improved version of Fysiks on php8 +1 for the good revision but there are still problems with view.php and admin_ban_add_online.php. If you try to open both pages you get a black page or the 500 code error page
Shico is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-12-2024 , 21:04   Re: AMXBans install
Reply With Quote #15

Quote:
Originally Posted by Shico View Post
The version AMXbans 1.6# It comes from the AMXbans version 6.0.3 version and was completely revised by amxx.pl This version has more than enough problems, I also tested it and I stick with the original code from the developer, which is also what I'm using right now improved version of Fysiks on php8 +1 for the good revision but there are still problems with view.php and admin_ban_add_online.php. If you try to open both pages you get a black page or the 500 code error page
I can't guarantee that I've got all the PHP8 issues resolved because I don't use every single function it provides. If you can give me the steps to reproduce issues I can look into fixing them.

What version of PHP is being used in the version you refer to as "AMXbans 1.6#"?
__________________
fysiks is offline
Shico
Junior Member
Join Date: Feb 2018
Old 01-14-2024 , 09:27   Re: AMXBans install
Reply With Quote #16

Quote:
Originally Posted by fysiks View Post
I can't guarantee that I've got all the PHP8 issues resolved because I don't use every single function it provides. If you can give me the steps to reproduce issues I can look into fixing them.

What version of PHP is being used in the version you refer to as "AMXbans 1.6#"?
I myself use Amxbans 6.14.4 on php8 everything works perfectly except for 2 things. I would be happy to take pictures of what happens then
The first picture with Amxbans was already in the server list and I shut down the server.
In the second picture you can see that when I start up the server an error page appears.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2024-01-14 152249.png
Views:	35
Size:	33.4 KB
ID:	202849   Click image for larger version

Name:	Screenshot 2024-01-14 152027.png
Views:	45
Size:	20.2 KB
ID:	202850  
Shico is offline
Shico
Junior Member
Join Date: Feb 2018
Old 01-14-2024 , 09:30   Re: AMXBans install
Reply With Quote #17

The View.php would have to be adapted so that the servers also appear in the list when they are started and when they are also offline

You can check it out here https://bans.teamoptimized.de/view.php

And this is what normal should look like

For security reasons I had to make the box black because of the IP address
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2024-01-14 155038.png
Views:	30
Size:	21.7 KB
ID:	202851  

Last edited by Shico; 01-14-2024 at 09:57.
Shico is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-14-2024 , 19:36   Re: AMXBans install
Reply With Quote #18

I'm not sure what you're describing here. In my test setup, I have two servers configured (both offline) and they show up properly. When I turn one of them on and refresh the page I get the info for that online server just like it is supposed to show (i.e. it looks just like the last image you posted).

I checked my friend's version which is hosted publicly and it's getting an error of "maximum execution time exceeded" for RCON. I don't get that on my local instance. Your instance at the link above seems to return immediately with a blank page (which means it's probably erroring in a different way. Getting that error log would be helpful.
__________________

Last edited by fysiks; 01-14-2024 at 19:45.
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode