SourceMod Donor
|
02-10-2011
, 18:37
Re: someone good with amx help me here
|
#3
|
Quote:
Originally Posted by Graham
nobody else had this problem on gametracker.com?
all real players being marked as bots is a real pain. if you look here:
http://i55.tinypic.com/358cfm1.jpg
then hlsw shows the negative player times. I thought that this was fixed by removing a few recent plugins and it was fixed after a server restart but it's not fixed anymore and has gone back to thinking that players are bots.
EDIT:
Here's the plugins I removed which I thought was the cause since they were the only change I made to my server before starting to have this problem.
Here's the first plugin:
PHP Code:
#include <amxmodx> #include <amxmisc>
#include <engine> #include <fakemeta>
new const Plugin[] = "Bad Clients Handler" new const Author[] = "joaquimandrade" new const Version[] = "1.0"
new Float:LastCommandReceivedTime[33] new IsConnected[33]
new class[] = "badClientsHandler" new MaxPlayers
new Float:ThinkDelay = 1.0
new CvarTimeout new CvarTimeoutRoundStart
public plugin_init() { register_plugin(Plugin,Version,Author) register_forward(FM_CmdStart,"cmdStart")
register_event("HLTV", "newRound", "a", "1=0", "2=0")
register_think(class,"handlerThink")
CvarTimeout = register_cvar("badclients_timeout","5.0") CvarTimeoutRoundStart = register_cvar("badclients_timeout_round","3.0 ") }
public newRound() { checkBadClients(get_pcvar_float(CvarTimeoutRo undStart)) }
public plugin_cfg() { MaxPlayers = get_maxplayers()
new thinker = create_entity("info_target") set_pev(thinker,pev_classname,class) handlerThink(thinker) }
checkBadClients(Float:timeout) { for(new i=1;i<=MaxPlayers;i++) { if(IsConnected[i]) { if( (get_gametime() - LastCommandReceivedTime[i]) >= timeout) { forceDisconnect(i) } } } }
public handlerThink(id) { checkBadClients(get_pcvar_float(CvarTimeout))
set_pev(id,pev_nextthink,get_gametime() + ThinkDelay) }
forceDisconnect(id) { /*static name[32] static steamID[34]
get_user_name(id,name,charsmax(name)) get_user_authid(id,steamID,charsmax(steamID))
log_to_file("badClientsHandler.txt","Forcing disconnect of client ^"%s<%s>^"",name,steamID) */ server_cmd("kick #%d",get_user_userid(id)) server_exec() }
public client_putinserver(id) { IsConnected[id] = !is_user_bot(id) LastCommandReceivedTime[id] = get_gametime() + 1.0 }
public client_disconnect(id) { if(IsConnected[id]) IsConnected[id] = false }
public cmdStart(id,uc_handle,random_seed) { LastCommandReceivedTime[id] = get_gametime() }
This is the other plugin:
PHP Code:
#include <amxmodx> #include <amxmisc>
#include <fakemeta>
#define PLUGIN "Anti-SVC (Will See)" #define AUTHOR "joaquimandrade" #define VERSION "1.0"
new ConfigFilename[] = "svc.cfg"
new AllowedPairsNames[][] = { "model", "name", "bottomcolor", "_cl_autowepswitch", "cl_dlmax", "cl_lc", "cl_lw", "cl_updaterate", "topcolor", "_vgui_menus", "_ah", "rate", "*sid", "lang" }
new AllowedPairsValueMaxLen[sizeof AllowedPairsNames] = { 50, 32, 3, 1, 4, 1, 1, 3, 3, 1, 1, 6, 30, 2 }
new Trie:AllowedPairsData
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_ClientUserInfoChanged,"in foChanged") }
public plugin_cfg() { new path[50]
get_configsdir(path,charsmax(path))
format(path,charsmax(path),"%s/%s",path,ConfigFilename)
AllowedPairsData = TrieCreate()
new file
new line[100]
if(file_exists(path)) { file = fopen(path,"r")
new pairName[50] new pairValueMaxLenString[3] new pairValueMaxLen
while(fgets(file,line,charsmax(line))) { parse(line,pairName,charsmax(pairName),pairVa lueMaxLenString,charsmax(pairValueMaxLenStrin g))
pairValueMaxLen = str_to_num(pairValueMaxLenString)
TrieSetCell(AllowedPairsData,pairName,pairVal ueMaxLen) } } else { file = fopen(path,"w")
for(new i=0;i<sizeof AllowedPairsNames;i++) { TrieSetCell(AllowedPairsData,AllowedPairsName s[i],AllowedPairsValueMaxLen[i]) formatex(line,charsmax(line),"%s %d^n",AllowedPairsNames[i],AllowedPairsValueMaxLen[i]) fputs(file,line) } }
fclose(file) }
readNextPairPart(buffer[],&position,pairPart[]) { if(buffer[position++]) { new i
do { pairPart[i++] = buffer[position++] } while(buffer[position] && (buffer[position] != '\'))
pairPart[i] = 0; } else { return false }
return true }
public infoChanged(id,buf[]) { static buffer[257] static pairName[50]
copy_infokey_buffer(engfunc(EngFunc_GetInfoKe yBuffer,id),buffer,charsmax(buffer));
new position
while(readNextPairPart(buffer,position,pairNa me)) { static pairValueMaxLen
if(TrieGetCell(AllowedPairsData,pairName,pair ValueMaxLen)) { static pairValue[50]
if(readNextPairPart(buffer,position,pairValue )) { if(strlen(pairValue) > pairValueMaxLen) { /*static name[32] get_user_info(id,"name",name,charsmax(name))
static steamID[34] get_user_authid(id,steamID,charsmax(steamID))
log_amx("<^"%s^"><^"%s^"> Pair value for ^"%s^" has an invalid length. Truncating",name,steamID,pairName) */ pairValue[pairValueMaxLen] = 0 set_user_info(id,pairName,pairValue) break; } } else { break; } } else { /*static name[32] get_user_info(id,"name",name,charsmax(name))
static steamID[34] get_user_authid(id,steamID,charsmax(steamID))
log_amx("<^"%s^"><^"%s^"> Pair name ^"%s^" is invalid. Clearing",name,steamID,pairName) */ set_user_info(id,pairName,"") break; } } } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1031\\ f0\\ fs16 \n\\ par } */
and the cfg for that last plugin:
PHP Code:
model 50 name 32 bottomcolor 3 _cl_autowepswitch 1 cl_dlmax 4 cl_lc 1 cl_lw 1 cl_updaterate 3 topcolor 3 _vgui_menus 1 _ah 1 rate 6 *sid 30 lang 2
Hopefully someone can help me out here, I really need to get this fixed because I work so hard on the server, having such a good rank on a place like gametracker is pretty rewarding.
|
Last edited by YamiKaitou; 07-21-2012 at 08:21.
Reason: Solved.
|
|