AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Anti-specbug (https://forums.alliedmods.net/showthread.php?t=110003)

Backstabnoob 11-23-2009 15:29

Anti-specbug
 
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")



Arkshine 11-23-2009 15:32

Re: Anti-specbug
 
First, the usage of cvar is wrong.

cvar_* is pointers. You have to use get_pcvar_num() with it.

Backstabnoob 11-23-2009 15:34

Re: Anti-specbug
 
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?

Styles 11-23-2009 18:17

Re: Anti-specbug
 
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()

ConnorMcLeod 11-24-2009 00:46

Re: Anti-specbug
 
To avoid spectator bugs, fix plugins that respawn players.

Styles 11-24-2009 02:59

Re: Anti-specbug
 
Quote:

Originally Posted by ConnorMcLeod (Post 997637)
To avoid spectator bugs, fix plugins that respawn players.

This too lol ;)

Backstabnoob 11-24-2009 13:34

Re: Anti-specbug
 
Thanks, did that and it works :D

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

Thanks anyway.

ConnorMcLeod 11-24-2009 17:03

Re: Anti-specbug
 
Quote:

Originally Posted by Backstabnoob (Post 997854)
Thanks, did that and it works :D

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.


All times are GMT -4. The time now is 13:42.

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