Raised This Month: $ Target: $400
 0% 

adminvote scripting help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jsterling
SourceMod Donor
Join Date: Mar 2004
Location: Denver, CO, USA
Old 12-20-2008 , 15:59   adminvote scripting help
Reply With Quote #1

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!

Last edited by jsterling; 12-20-2008 at 16:25.
jsterling is offline
Send a message via AIM to jsterling
jsterling
SourceMod Donor
Join Date: Mar 2004
Location: Denver, CO, USA
Old 12-22-2010 , 18:16   Re: adminvote scripting help
Reply With Quote #2

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!
jsterling is offline
Send a message via AIM to jsterling
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-22-2010 , 19:18   Re: adminvote scripting help
Reply With Quote #3

quotes.
__________________
fysiks is offline
jsterling
SourceMod Donor
Join Date: Mar 2004
Location: Denver, CO, USA
Old 12-22-2010 , 20:45   Re: adminvote scripting help
Reply With Quote #4

Could you tell me where?

Last edited by jsterling; 12-22-2010 at 20:50.
jsterling is offline
Send a message via AIM to jsterling
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-22-2010 , 22:00   Re: adminvote scripting help
Reply With Quote #5

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";     }
__________________
Brad is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 12-22-2010 , 22:00   Re: adminvote scripting help
Reply With Quote #6

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

There's an example.
__________________
Hi.

Last edited by Kreation; 12-22-2010 at 22:01. Reason: brad, you devil you.
Kreation is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-22-2010 , 22:30   Re: adminvote scripting help
Reply With Quote #7

Quote:
Originally Posted by Brad View Post
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.
__________________
fysiks is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-22-2010 , 23:08   Re: adminvote scripting help
Reply With Quote #8

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!
__________________
Brad is offline
jsterling
SourceMod Donor
Join Date: Mar 2004
Location: Denver, CO, USA
Old 12-23-2010 , 00:08   Re: adminvote scripting help
Reply With Quote #9

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!
jsterling is offline
Send a message via AIM to jsterling
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 12-23-2010 , 02:59   Re: adminvote scripting help
Reply With Quote #10

Put it in quotes like you have the string.
__________________
Hi.
Kreation is offline
Reply


Thread Tools
Display Modes

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 09:11.


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