AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   adminvote scripting help (https://forums.alliedmods.net/showthread.php?t=82294)

jsterling 12-20-2008 15:59

adminvote scripting help
 
I am trying to have adminvote ban using amxbans instead of the built in HL system. I've edited the default adminvote.sma to try and accomplish this.

I changed this:
PHP Code:

if (voteban)
{
if (
ipban==true)
{
g_Answer "addip 30.0 %s";
}
else
{
g_Answer "banid 30.0 %s kick";
}
}
else
{
g_Answer "kick #%s";


To this:
PHP Code:

if (voteban)
{
if (
ipban==true)
{
g_Answer "amx_ban 30.0 %s Voteban";
}
else
{
g_Answer "amx_ban 30.0 %s Voteban";
}
}
else
{
g_Answer "kick #%s";


The command is never sent to amxbans though. It says it's banning but players never get banned or kicked. Can anyone give me a suggestion?

Thanks!

jsterling 12-22-2010 18:16

Re: adminvote scripting help
 
This is an old bump and I can't remember how I did it in the past but I lost all of my files awhile ago and am trying to accomplish this again.

Can anyone give me a hand?

Thanks!

fysiks 12-22-2010 19:18

Re: adminvote scripting help
 
quotes.

jsterling 12-22-2010 20:45

Re: adminvote scripting help
 
Could you tell me where?

Brad 12-22-2010 22:00

Re: adminvote scripting help
 
While I'm not entirely sure, I thought that I had seen that one of the more recent updates to AMXBans switched the order of minutes and player identification. If that is the problem, you might be able to just switch the two, as shown below:

Code:
    if (voteban)     {         if (ipban==true)         {             g_Answer = "amx_ban %s 30.0 Voteban";         }         else         {             g_Answer = "amx_ban %s 30.0 Voteban";         }     }     else     {         g_Answer = "kick #%s";     }

I'm not convinced the issue is with quotes. If you did have to add quotes, they'd be like:

Code:
    if (voteban)     {         if (ipban==true)         {             g_Answer = "amx_ban ^"%s^" 30.0 Voteban";         }         else         {             g_Answer = "amx_ban ^"%s^" 30.0 Voteban";         }     }     else     {         g_Answer = "kick #%s";     }

Kreation 12-22-2010 22:00

Re: adminvote scripting help
 
Code:
server_cmd( "kick #%d ^"%s^"", iUserID, szReason );

There's an example.

fysiks 12-22-2010 22:30

Re: adminvote scripting help
 
Quote:

Originally Posted by Brad (Post 1377134)
While I'm not entirely sure, I thought that I had seen that one of the more recent updates to AMXBans switched the order of minutes and player identification. If that is the problem, you might be able to just switch the two, as shown below:

code

I'm not convinced the issue is with quotes. If you did have to add quotes, they'd be like:

I believe the argument order was changable by cvar to preserve backward compatability by default.

Another issues is that he uses the %s differently in two of the three cases for that one g_answer variable. If he intends to use the UserID then he needs to add the # to the first two. If he intends to use name or SteamID then he needs quotes.

Brad 12-22-2010 23:08

Re: adminvote scripting help
 
Nah. He's doing it the way it was originally coded. The correct value gets put in for each case. I tried following the logic in adminvote.sma but was like, screw it.

I had PM'd him earlier asking him to make a change where the plugin is actually sending the command, to print it to chat rather than sending it. That way we'd have a good idea what exactly it's sending. And by a "good idea" I mean we'll know. Hopefully we'll see that soon.

@Kreation: Ha! My 10:00pm is earlier than your 10:00pm!

jsterling 12-23-2010 00:08

Re: adminvote scripting help
 
Brad, the code you gave me in the PM caused a compile error.

This work's though:
Code:

    if (voteban)
    {
        if (ipban==true)
        {
            g_Answer = "amx_banip ^"%s^" 30 Voteban";
        }
        else
        {
            g_Answer = "amx_ban ^"%s^" 30 Voteban";
 
        }
    }
    else
    {
        g_Answer = "kick #%s";
    }

The only problem is that it displays the reason as "0 Voteban"

How do I get rid of the 0 in the reason?

Thanks a lot guys!

Kreation 12-23-2010 02:59

Re: adminvote scripting help
 
Put it in quotes like you have the string.


All times are GMT -4. The time now is 09:11.

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