Raised This Month: $ Target: $400
 0% 

Anti-specbug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-23-2009 , 15:29   Anti-specbug
Reply With Quote #1

I tried to post this as a plugin, but I failed because it would not work. I ask - why?
PHP Code:
#include <amxmodx>
#include <cstrike>

#define PLUGIN "auto kill & ban spec buggers"
#define VERSION "1.0"
#define AUTHOR "backstabnoob"

new cvar_Timecvar_useAmxBanscvar_Bancvar_Slay

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
set_task(1.0"cmdKillBanSpectators")
    
cvar_Time register_cvar("specbug_time""10080")
    
cvar_useAmxBans register_cvar("specbug_amxbans""1")
    
cvar_Ban register_cvar("specbug_ban""1")
    
cvar_Slay register_cvar("specbug_slay""1")
}

public 
cmdKillBanSpectators(id) {
    if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR && is_user_alive(id)) {
        new 
Userid get_user_userid(id)
        new 
Authid[29]
        
get_user_authid(idAuthid28)
        if(
cvar_Slay == 1) {
            
user_kill(id)
        }
        if(
cvar_Ban == 1) {
            if(
cvar_useAmxBans == 1) {
                
server_cmd("amx_ban %d %s Specbug"cvar_TimeAuthid)
                } else {
                
server_cmd("kick #%d Specbug",Userid)
                
server_cmd("banid %d %s"cvar_TimeAuthid)
                
server_cmd("writeid")
            }
        }
        
    }
    
set_task(1.0"cmdKillBanSpectators")

Backstabnoob is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-23-2009 , 15:32   Re: Anti-specbug
Reply With Quote #2

First, the usage of cvar is wrong.

cvar_* is pointers. You have to use get_pcvar_num() with it.
__________________
Arkshine is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-23-2009 , 15:34   Re: Anti-specbug
Reply With Quote #3

Oh, god. get_pcvar_num(cvar_Time) etc. would be better?

So, if that was the only reason it didn't work, can I update quickly my posted plugin? :/


Nope, it still doesn't work. I figured how to bug it, but now, it doesn't kill me while playing as a spectator. Anybody know what's with that?

Last edited by Backstabnoob; 11-23-2009 at 16:05.
Backstabnoob is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-23-2009 , 18:17   Re: Anti-specbug
Reply With Quote #4

The fact that this wont do ANYTHING is funny.

Ok, you have cmdKillBanSpectators(id). You never pass ID so you need to get a list of players then loop though them. Also, change the function name to cmdKillBanSpectators()
Styles is offline
Send a message via AIM to Styles
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-24-2009 , 00:46   Re: Anti-specbug
Reply With Quote #5

To avoid spectator bugs, fix plugins that respawn players.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-24-2009 , 02:59   Re: Anti-specbug
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
To avoid spectator bugs, fix plugins that respawn players.
This too lol ;)
Styles is offline
Send a message via AIM to Styles
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-24-2009 , 13:34   Re: Anti-specbug
Reply With Quote #7

Thanks, did that and it works

Btw, Connor: Nope. They are bugging it purposely, I just want those mofoz to pay for that.

Thanks anyway.
Backstabnoob is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-24-2009 , 17:03   Re: Anti-specbug
Reply With Quote #8

Quote:
Originally Posted by Backstabnoob View Post
Thanks, did that and it works

Btw, Connor: Nope. They are bugging it purposely, I just want those mofoz to pay for that.

Thanks anyway.
I understand, but fix the respawn plugin and bugs are gone.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 13:42.


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