AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] AFK Manager (Version 4.3.0 / Updated July 2nd 2018) (https://forums.alliedmods.net/showthread.php?t=79904)

Rothgar 11-01-2008 02:59

[ANY] AFK Manager (Version 4.3.0 / Updated July 2nd 2018)
 
5 Attachment(s)
AFK Manager

Table of Contents
Information

This plugin has been designed to manage AFK players, it has a General AFK check along with a Spawn AFK check. It checks player commands for button changes and mouse movements to determine if a player is "AFK". If the player is not "typing/chatting", pressing any buttons or performing any movements of their mouse, they are deemed "AFK" and the plugin can move and/or kick them after a specified amount of time. It will warn players who are detected as "AFK" before being moved or kicked based on specific variables in 5 second intervals.

This plugin has been designed to utilize a translation file for use of other languages.


Requirements
SourceMod v1.4.0+ (Previous version 3 branch)
SourceMod v1.7.0+ (Latest version 4 branch)

For Automatic Update support you need to do the following:
You need to compile the plugin manually with the "updater.inc" as per the compile instructions below.

You can download the latest version of the SourceMod "Updater" include file and plugin from:

http://forums.alliedmods.net/showthread.php?t=169095

For Color support you need to do the following:
You need to compile the plugin manually either with "Multi Colors" (preferred), "morecolors.inc" or "colors.inc" as per the compile instructions below.

Multi Colors:
Note: Latest "Multi Colors" version requires SourceMod 1.7.0+
Old Release Commit (Working with SourceMod 1.5.0 if you are using version 3): https://git.tf/Bara/Multi-Colors/tree/89cdb804ffc6544b72ec239ea4c507af68de14c8/addons/sourcemod/scripting/include

You can download the latest version of the SourceMod "Multi Colors" include file(s) from:

https://forums.alliedmods.net/showthread.php?t=247770


More Colors (morecolors.inc):
Note: Latest "More Colors" version now requires compiling with SourceMod 1.5.0+ and does not work properly for at least CS:GO

You can download the latest version of the SourceMod "More Colors" include file from:

https://forums.alliedmods.net/showthread.php?t=185016

Colors (colors.inc):
Note: This include is no longer supported and fails on some newer mods/servers

You can download the latest version of the SourceMod "Colors" include file from:

https://forums.alliedmods.net/showthread.php?t=96831

Installation Details

Download the "afk_manager.phrases.txt" and save to your addons\sourcemod\translations directory.

Pre-compiled:
Download using the "Get Plugin" link and save to your addons\sourcemod\plugins directory.

Self-Compile:
Download the "afk_manager4.sp" using the "Get Source" link and save to your addons\sourcemod\scripting directory.

Quote:

If you want Automatic Update support you need to:

A) Have the "Updater" plugin already loaded/running
B) Compile the AFK Manager with the corresponding "updater.inc" include file. *
* The "updater.inc" file should be saved in the addons\sourcemod\scripting\include directory before compile.

Please read the requirements section for more details.
Quote:

If you want Color support you need to compile with the color include file(s), please read the requirements section for more details.

For "Multi Colors" there are currently 3 include files that need to be used:
"multicolors.inc" should be installed to addons\sourcemod\scripting\include directory.
"colors.inc" (From Multi Colors) should be saved to addons\sourcemod\scripting\include\multicolor s directory.
"morecolors.inc" (From Multi Colors) should be saved to addons\sourcemod\scripting\include\multicolor s directory.

Otherwise for "More Colors" or "Colors", download the corresponding include file and save to addons\sourcemod\scripting\include directory.
Quote:

To Compile with Debug Enabled:

Open the "afk_manager(3 or 4).sp" in a text editor and set "_DEBUG" to 1
Compile the plugin and install as per normal.

NOTE: If you get an error I would first recommend updating your SourceMod.


Server Console Variables (ConVars)
  • sm_afkm_version - Current version of the AFK Manager. (No edit)
  • sm_afk_enable - Is the AFK Manager enabled or disabled? [0 = FALSE, 1 = TRUE, DEFAULT: 1]
  • sm_afk_autoupdate - Is the AFK Manager automatic plugin update enabled or disabled? (Requires SourceMod Autoupdate plugin) [0 = FALSE, 1 = TRUE]
  • sm_afk_prefix_short - Should the AFK Manager use a short prefix? [0 = FALSE, 1 = TRUE, DEFAULT: 0]
  • sm_afk_prefix_color - Should the AFK Manager use color for the prefix tag? [0 = DISABLED, 1 = ENABLED, DEFAULT: 1] (Requires compiling with SourceMod Colors include)
  • sm_afk_force_language - Should the AFK Manager force all message language to the server default? [0 = DISABLED, 1 = ENABLED, DEFAULT: 0]
  • sm_afk_log_warnings - Should the AFK Manager log plugin warning messages. [0 = FALSE, 1 = TRUE, DEFAULT: 1]
  • sm_afk_log_moves - Should the AFK Manager log client moves. [0 = FALSE, 1 = TRUE, DEFAULT: 1]
  • sm_afk_log_kicks - Should the AFK Manager log client kicks. [0 = FALSE, 1 = TRUE, DEFAULT: 1]
  • sm_afk_log_days - How many days should we keep AFK Manager log files. [0 = INFINITE, DEFAULT: 0]
  • sm_afk_move_min_players - Minimum number of connected clients required for AFK move to be enabled. [DEFAULT: 4]
  • sm_afk_kick_min_players - Minimum number of connected clients required for AFK kick to be enabled. [DEFAULT: 6]
  • sm_afk_admins_immune - Should admins be immune to the AFK Manager? [0 = DISABLED, 1 = COMPLETE IMMUNITY, 2 = KICK IMMUNITY, 3 = MOVE IMMUNITY]
  • sm_afk_admins_flag - Admin Flag for immunity? Leave Blank for any flag.
  • sm_afk_move_spec - Should the AFK Manager move AFK clients to spectator team? [0 = FALSE, 1 = TRUE, DEFAULT: 1]
  • sm_afk_move_announce - Should the AFK Manager announce AFK moves to the server? [0 = DISABLED, 1 = EVERYONE, 2 = ADMINS ONLY, DEFAULT: 1]
  • sm_afk_move_time - Time in seconds (total) client must be AFK before being moved to spectator. [0 = DISABLED, DEFAULT: 60.0 seconds]
  • sm_afk_move_warn_time - Time in seconds remaining, player should be warned before being moved for AFK. [DEFAULT: 30.0 seconds]
  • sm_afk_kick_players - Should the AFK Manager kick AFK clients? [0 = DISABLED, 1 = KICK ALL, 2 = ALL EXCEPT SPECTATORS, 3 = SPECTATORS ONLY]
  • sm_afk_kick_announce - Should the AFK Manager announce AFK kicks to the server? [0 = DISABLED, 1 = EVERYONE, 2 = ADMINS ONLY, DEFAULT: 1]
  • sm_afk_kick_time - Time in seconds (total) client must be AFK before being kicked. [0 = DISABLED, DEFAULT: 120.0 seconds]
  • sm_afk_kick_warn_time - Time in seconds remaining, player should be warned before being kicked for AFK. [DEFAULT: 30.0 seconds]
  • sm_afk_spawn_time - Time in seconds (total) that player should have moved from their spawn position. [0 = DISABLED, DEFAULT: 20.0 seconds]
  • sm_afk_spawn_warn_time - Time in seconds remaining, player should be warned for being AFK in spawn. [DEFAULT: 15.0 seconds]
  • sm_afk_exclude_dead - Should the AFK Manager exclude checking dead players? [0 = FALSE, 1 = TRUE, DEFAULT: 0]
  • sm_afk_move_warn_unassigned - Should the AFK Manager warn team 0 (Usually unassigned) players? (Disabling may not work for some games) [0 = FALSE, 1 = TRUE, DEFAULT: 1]
  • sm_afk_buttons - How many button changes should the AFK Manager track before resetting AFK status? [0 = DISABLED, DEFAULT: 5]
* Note: The cfg file should be automatically created when the plugin is first loaded in cfg\sourcemod\afk_manager.cfg. If you delete this file it will re-create with the correct (default) cvars on plugin start/map change.

Server Commands
  • sm_afk_spec - Usage: sm_afk_spec <#userid|name>
Plugin Developer Information & Examples

If you are a plugin developer who wants to add mod specific or server specific functionality to the AFK Manager or to be able to detect AFK status in your own plugin you can now use the Native and Forwards I have created to do so. If you want a generic AFK feature to be added which would be beneficial to any mod, post in the thread so I can review.

Information can be found in the afk_manager.inc and the features are currently implemented in the latest release, I believe the functions are about 80% complete, so be aware they could change in the future. I am open to any feedback on whether you want to get more information from the AFK Manager or whether you think any of the current functions should change.

Example Plugins for Developers

I have written a couple of small example plugins for Counter-Strike/CS:GO to show a few methods of how you can use the AFK Manager natives and forwards:

Example Plugin #1

This plugin does not use any of the forwards: http://afkmanager.dawgclan.net/scrip...ger_cstrike.sp

The plugin was based off RedSwords original AFK Bomb plugin (https://forums.alliedmods.net/showthread.php?t=152329).

In the example you can see how I check for "Active" Terrorist players (Not marked as AFK for even 1 second) in the AFK_RandomBomb() function using AFKM_IsClientAFK().

You can also see how I have created a timer for any players with the Bomb and take action after a certain amount of AFK time in the Timer_CheckPlayer() function using AFKM_GetClientAFKTime().

Please note while I was making this I found there was a bug in the CS_DropWeapon() function for CS:GO where the toss was not working which has been fixed in release 1.8.0.6009 and 1.9.0.6101, thanks to the #SourceMod guys for their input help and fixes.

Example Plugin #2

This plugin is more specific to CS:GO around Team Swapping Issues/Modifications: http://afkmanager.dawgclan.net/scrip..._teamchange.sp

In this example you can see how I use the "AFK" forward events for "afk_move" and "afk_kick" to mark the player as "Moved" so that we can allow them to join a team again straight away by bypassing the "Pending" team change mode that Valve has implemented.

I have also on request added a couple of additional options to:

Provided a variable to override the pending team change for all players irrespective of whether they were moved by the AFK manager.

Provided a variable to block players from changing directly between Terrorist and Counter-Terrorist Teams.

Again these plugin are examples, there are no current translations or anything to notify players about the actions taken in these plugins.

If people are interested in me enhancing these to actually be a full blown sister plugin with certain features or want to take the projects on yourself let me know.

Change Log

* See the afk_manager.changelog.txt for old version information.
  • 4.3.0
Added:
- Added new AFK buttons variable which will allow you to disable button change detection completely (Would rely on mouse movements only) or track a certain number of unique buttons.

Please let me know if you experience any issues or problems.

Credits
  • Asherkin - For finding the CSGO team change limit offset.
  • Psychonic & Asherkin - For fixing mouse detection functionality in the SourceMod core.

Completed Language Translations
  • English (By Rothgar)
  • French (By Cadav0r)
  • Russian (By Snake60 & SelaX)
  • Spanish (By eradeejay)
  • German (By Guggie & Spawn86)
  • Portuguese (By away000 & paulo_crash)
  • Hungarian (By KhyrOO & blue zebra)
  • Polish (By Zuko & Arcy)
  • Turkish (By ZuCChiNi)
  • Norwegian (By checkster)
  • Norwegian (By checkster)
  • Italian (By Obyboby)
  • Czech (By Wooky_)

Other plugins made by me:

Anti-TK Manager: http://forums.alliedmods.net/showthread.php?t=80554


File Information

afk_manager-compat - This is an old release which is no longer kept up-to-date and only available for older SourceMod releases. It can be found in the afk_manager_old.zip
afk_manager3 - This was the previous version. It can be found in the afk_manager_old.zip
afk_manager4 - This is the current version.

Most people should use the new version that is NOT in the zip file.

Compiled Download with Multi Colors and Updater
If you are looking for a compiled download of the latest version of the AFK Manager which includes both "Multi Colors" and "Updater" include files, you can use the Updater download URL
Must User Right Click Save As: http://afkmanager.dawgclan.net/plugins/afk_manager4.smx

The compiled download URL should be static and contain the latest version of the plugin if you for example want to add to server provisioning scripts or similar, please also make sure you get the translation file either through the forum or via the Updater download URL http://afkmanager.dawgclan.net/trans...er.phrases.txt

crazydog 11-01-2008 06:31

Re: AFK Manager
 
Quote:

Originally Posted by web compiler
/home/groups/sourcemod/compiler/include/sdktools_stocks.inc(57) : error 001: expected token: ";", but found "for"
/home/groups/sourcemod/upload_tmp/textRyuSvp.sp(77) : error 017: undefined symbol "MaxClients"
/home/groups/sourcemod/upload_tmp/textRyuSvp.sp(89) : error 017: undefined symbol "MaxClients"

Adding the ; in sdktools_stocks.inc fixes that error, but the other two still show up.

Now, I'm no sourcemod developer, but adding
new MaxClients = GetMaxClients();
after the lines
// Late Load?
and
public OnMapStart()
{
caused it to compile correctly....I'll test it...

(note: Web Compile will not work because of the missing semicolon)

Also, it's not working in synergy. My config is this:
Code:

// This file was auto-generated by SourceMod (v1.0.4)
// ConVars for plugin "afkmgr.smx"


// Admins immune to being kicked? [0 = FALSE, 1 = TRUE]
// -
// Default: "1"
sm_adminsimmune "0"

// Is the AFK manager enabled or disabled? [0 = FALSE, 1 = TRUE]
// -
// Default: "1"
sm_afkenable "1"

// Minimum amount of connected clients needed to kick AFK clients.
// -
// Default: "6"
sm_minplayerskick "0"

// Minimum amount of connected clients needed to move AFK clients to spec.
// -
// Default: "4"
sm_minplayersmove "0"

// Move AFK clients to spec before kicking them? [0 = FALSE, 1 = TRUE]
// -
// Default: "1"
sm_movespec "0"

// Time in seconds before kicking an AFK player.
// -
// Default: "120.0"
sm_timetokick "5.0"

// Time in seconds before moving an AFK player.
// -
// Default: "60.0"
sm_timetomove "5.0"

and it's not kicking me.

Lebson506th 11-01-2008 08:28

Re: AFK Manager
 
He compiled it vs. 1.1.0 which contains the variable MaxClients and the ; in sdk_tools.

Rothgar 11-01-2008 11:32

Re: AFK Manager
 
Quote:

Originally Posted by crazydog (Post 708309)
Adding the ; in sdktools_stocks.inc fixes that error, but the other two still show up.

Now, I'm no sourcemod developer, but adding
new MaxClients = GetMaxClients();
after the lines
// Late Load?
and
public OnMapStart()
{
caused it to compile correctly....I'll test it...

(note: Web Compile will not work because of the missing semicolon)

Also, it's not working in synergy. My config is this:
Code:

// This file was auto-generated by SourceMod (v1.0.4)
// ConVars for plugin "afkmgr.smx"


// Admins immune to being kicked? [0 = FALSE, 1 = TRUE]
// -
// Default: "1"
sm_adminsimmune "0"

// Is the AFK manager enabled or disabled? [0 = FALSE, 1 = TRUE]
// -
// Default: "1"
sm_afkenable "1"

// Minimum amount of connected clients needed to kick AFK clients.
// -
// Default: "6"
sm_minplayerskick "0"

// Minimum amount of connected clients needed to move AFK clients to spec.
// -
// Default: "4"
sm_minplayersmove "0"

// Move AFK clients to spec before kicking them? [0 = FALSE, 1 = TRUE]
// -
// Default: "1"
sm_movespec "0"

// Time in seconds before kicking an AFK player.
// -
// Default: "120.0"
sm_timetokick "5.0"

// Time in seconds before moving an AFK player.
// -
// Default: "60.0"
sm_timetomove "5.0"

and it's not kicking me.

Yes the ; was not in there which was an error, I logged a bug report and this should be fixed in the latest trunk? So you can either add the ; manually or yeah download the latest SourceMod trunk build.

I believe MaxPlayers has been modified by pred to make it work, I remember seeing a commit saying the rtv plugin etc have been changed to use this new variable, not sure if it's only in the 1.1 trunk or not.

As for your problem with it not working change sm_minplayersmove to be at least 1, I believe 0 would be disabled.

Ok was just told that the MaxClients variable might be 1.1 only, if there is a need to use with 1.0 SourceMod versions let me know and I'll make some changes.

DontWannaName 11-01-2008 16:01

Re: AFK Manager
 
Dont forget to post the compiled plugin as an smx so everyone doesnt have to compile. Are a flagged clients immune too?

Rothgar 11-01-2008 20:22

Re: AFK Manager
 
Ok changed the MaxClients variable to try and use the older method supported by 1.0x branch of SourceMod.

Uploaded a compiled version of the plugin as well.

Quote:

Originally Posted by DontWannaName (Post 708531)
Are a flagged clients immune too?

They should be it checks if the client is an admin which I believe returns for any flag.

crazydog115 11-01-2008 22:23

Re: AFK Manager
 
Now I'm getting this error:

Quote:

L 11/01/2008 - 19:16:51: [SM] Native "IsClientConnected" reported: Client index 11 is invalid
L 11/01/2008 - 19:16:51: [SM] Debug mode is not enabled for "afk_manager.smx"
L 11/01/2008 - 19:16:51: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 24 on
Trying to turn debug on gives me this:
Quote:

[SM] Could not toggle debug mode on plugin afk_manager.smx.
[SM] Plugin returned error: Plugin is not runnable.
Sourcemod 1.0.4 , build 2537 running on Synergy.

Rothgar 11-02-2008 05:05

Re: AFK Manager
 
Er,

Can you type sm plugins list

Tell me if the plugin is loaded?

Then check the plugin number and type sm plugins debug # on

Where # is replaced with the plugin number and tell me if it still says the plugin is not runnable??? it it was not runnable then how did it even get to the error message.

Once I know where it's complaining about checking the IsClientConnected I can look at fixing it but I don't think that error should be causing any problems, sounds like maybe it was doing a check but the client was disconnected or disconnecting or something.

Also upon some checking, I think the attached compiled smx file was wrong, I have uploaded a new version.

Rothgar 11-02-2008 06:49

Re: AFK Manager
 
Ok after consideration I have now changed this plugin and made it require 1.1 trunk version of SourceMod, you can read the original post for more details.

crazydog 11-02-2008 15:52

Re: AFK Manager
 
First of all, Synergy doesn't like SM 1.1

Second, I'll answer your questions anyway:

The plugin IS loaded with errors
I told you what happens when I try to turn on debug

Rothgar 11-02-2008 16:03

Re: AFK Manager
 
Quote:

Originally Posted by crazydog (Post 709115)
First of all, Synergy doesn't like SM 1.1

Second, I'll answer your questions anyway:

The plugin IS loaded with errors
I told you what happens when I try to turn on debug

Ok if you say so, I have been running Synergy with SourceMod 1.1 since the OB release and have reported numerous bugs which included:

SourceMod v1.1.0-2365 - Created new "OnClientConnected()" forward which correctly handles players connecting for mods like Synergy.

This OnClientConencted() correctly identifies when a client connects matching it with OnClientDisconnect(). If you use OnClientConnect() and a player is disconnected by the server for not having the required mounts OnClientDisconnect() is not called causing problems.

This was causing issues with RTV ending up having incorrect numbers amongst probably other plugins hence why OnClientConnected() was created and RTV plugins were changed.

https://bugs.alliedmods.net/show_bug.cgi?id=3376
https://bugs.alliedmods.net/show_bug.cgi?id=3311
https://bugs.alliedmods.net/show_bug.cgi?id=3312

But yeah ok if you say it doesn't work when I clearly know it's working and as I mentioned I am using a new OnClientConnected() function to fix the client connections which is only in the 1.1 trunk.

I believe you are probably having issues because we determined 1.0.x is probably thinking the OnClientConnected() function is a custom function not a SourceMod function. The issue you were seeing with IsClientConnected() I believe I have fixed in the next release I'll make and should of only been applicable for late-loading the plugin where it was checking the players wrong and should have been using IsClientInGame()

crazydog 11-03-2008 01:00

Re: AFK Manager
 
Maybe this could help?

Quote:

I see many level designers wanting to know the number of players in the server and so on.
I'm posting this here to get a feel of what people want this new proposed entity to do:

logic_player_counter

Outputs:
* void OnPlayerConnect() = fired when a player connects to the server
* void OnPlayerDisconnect() = fired when a player leaves the server
* integer OutPlayerCount() = value of number of players

Ideas/Suggestions?
It's not implemented yet, but if it was, could this help?

I'm not sure if you can access those from SM plugins though. I'm not familiar with any programming related to the source engine.

Rothgar 11-03-2008 01:34

Re: AFK Manager
 
Quote:

Originally Posted by crazydog (Post 709290)
Maybe this could help?



It's not implemented yet, but if it was, could this help?

I'm not sure if you can access those from SM plugins though. I'm not familiar with any programming related to the source engine.

Er no, why don't you read the posts where I stated the problems and why I have done it this way and as said Synergy SHOULD/WILL work better on 1.1 due to the bugs I listed being resolved.

Rothgar 11-06-2008 03:55

Re: AFK Manager
 
Uploaded 2.5e which is just a few slight changes, one was the error message on late-load that was mentioned before giving invalid indexes. This should be resolved now and the other was that DEBUG was enabled by default which would have generated more debug information which may have some performance impacts, this has been disabled by default now.

1nsane 11-06-2008 05:54

Re: AFK Manager
 
It fails to load in TF2 right of the bat. Compiling it against the latest stable sourcemod version gets it to load but it doesn't actually do anything.

:/

Rothgar 11-06-2008 07:55

Re: AFK Manager
 
Can you tell me the output of your "sm version" ?

Have you compiled with DEBUG enabled and do you have anything in the SourceMod logs?

Rothgar 11-07-2008 06:10

Re: AFK Manager
 
Uploaded version 2.5f

Fixed a few error messages that would occur when changing maps due to the timer starting before a player was fully in the server. Also added a few more debug messages for DEBUG mode.

Rothgar 11-08-2008 08:38

Re: AFK Manager
 
Has anyone tried the Spectator move function at all? Does it work etc?

Alderman [3rd MD] 11-09-2008 14:09

Re: AFK Manager
 
This doesnt appear to run in my INS server with 1.0.4 on Windows OS.
No errors in the log but it never moves anyone to spec or kicks them whatsoever.

Rothgar 11-09-2008 17:09

Re: AFK Manager
 
Quote:

Originally Posted by Alderman [3rd MD] (Post 712103)
This doesnt appear to run in my INS server with 1.0.4 on Windows OS.
No errors in the log but it never moves anyone to spec or kicks them whatsoever.

Please read the first post, this plugin currently requires 1.1 trunk.

retsam 11-14-2008 21:05

Re: AFK Manager
 
Plugin wont load up on SM 1.1.0.2419 windows server.

Error: [SM] Unable to load plugin "afk_manager.smx": Native "VerifyCoreVersion" was not found.

Also have bunch of compile errors.



//// afk_manager.sp
// \addons\sourcemod\scripting\include\sdktools_ stocks.inc(57) : error 001: expected token: ";", but found "for"
// afk_manager.sp(78) : error 017: undefined symbol "MaxClients"
// afk_manager.sp(102) : error 017: undefined symbol "MaxClients"
// afk_manager.sp(317) : error 017: undefined symbol "MaxClients"



ALSO..........I notice you clearly got this idea or copied alot of the code from Liam.... If you notice his directions for the cvars are to go into cfg\sourcemod\afk_manager.cfg. You have the exact same config and cvars used on yours lol... You shouldnt be using the same config file if thats even where the cvars are supposed to go. You should also change the cvars so they are different from his. I suppose in this case it doesnt matter since nobody would be loading 2 afk managers at the same time but....

Furthermore, both of you should have the custom config auto-created with default cvars in the first place, instead of forcing admins to go make the config file and copy/paste the cvars in.

If youre going to do it that way, its a bit nicer for people if you at least list the cvars in the same format as the config files so at least we can just copy/paste them in.

Rothgar 11-15-2008 00:35

Re: AFK Manager
 
Quote:

Originally Posted by retsam (Post 713972)
Plugin wont load up on SM 1.1.0.2419 windows server.

Error: [SM] Unable to load plugin "afk_manager.smx": Native "VerifyCoreVersion" was not found.

Also have bunch of compile errors.



//// afk_manager.sp
// \addons\sourcemod\scripting\include\sdktools_ stocks.inc(57) : error 001: expected token: ";", but found "for"
// afk_manager.sp(78) : error 017: undefined symbol "MaxClients"
// afk_manager.sp(102) : error 017: undefined symbol "MaxClients"
// afk_manager.sp(317) : error 017: undefined symbol "MaxClients"



ALSO..........I notice you clearly got this idea or copied alot of the code from Liam.... If you notice his directions for the cvars are to go into cfg\sourcemod\afk_manager.cfg. You have the exact same config and cvars used on yours lol... You shouldnt be using the same config file if thats even where the cvars are supposed to go. You should also change the cvars so they are different from his. I suppose in this case it doesnt matter since nobody would be loading 2 afk managers at the same time but....

Furthermore, both of you should have the custom config auto-created with default cvars in the first place, instead of forcing admins to go make the config file and copy/paste the cvars in.

If youre going to do it that way, its a bit nicer for people if you at least list the cvars in the same format as the config files so at least we can just copy/paste them in.

Please read the first port "Requirements" section you need SourceMod v1.1.0-2383+

You have 2419? the latest I see is 2401? Can you give me an output of "sm version"

Both of those errors you posted indicate you probably don't have the correct version as the Requirements section shows which version both of those were fixed in?

Yes, It was already stated that this plugin was Liam's original code with modifications as stated in the initial port? Feel free to read through it to see what has been changed. Therefore I see no need to change the config file at this point because yes as you said you would not run multiple AFK Managers and at current all the cvars are the same. There is no need "at this point" to change the cvars. I have changed the version cvar so they can be identified differently.

I am fairly sure I did not touch the cvar generation parts and if the file does not exist and you load the plugin successful either on load or on map change the file should be automatically generated?

nbtc971 11-15-2008 02:30

Re: AFK Manager
 
*edit*

Never mind, that was too negative so I'm removing it. I'll just say, sounds like a nice plugin, but i'm not moving off a STABLE release of sourcemod to install it. Thanks for your work however and I look forward to trying it out when 1.1 is final.

retsam 11-15-2008 02:56

Re: AFK Manager
 
Quote:

Originally Posted by nbtc971 (Post 714000)
*edit*

Never mind, that was too negative so I'm removing it. I'll just say, sounds like a nice plugin, but i'm not moving off a STABLE release of sourcemod to install it. Thanks for your work however and I look forward to trying it out when 1.1 is final.


Me either. If it doesnt work in my SM version of 1.1.0.2419 which is proven stable, im not changing. Thanks for the efforts and improvements. I love getting and using improved plugins, but this doesnt work so I went with Liams.

I will say, just fyi if it doesnt work with 1.1.0.2419 which many admins use, I highly doubt this will work with many other versions.

Rothgar 11-15-2008 06:24

Re: AFK Manager
 
Quote:

Originally Posted by retsam (Post 714004)
Me either. If it doesnt work in my SM version of 1.1.0.2419 which is proven stable, im not changing. Thanks for the efforts and improvements. I love getting and using improved plugins, but this doesnt work so I went with Liams.

I will say, just fyi if it doesnt work with 1.1.0.2419 which many admins use, I highly doubt this will work with many other versions.

As stated I don't know where you are finding this "2419" build? The latets I see on the snapshot page is 2401? Can you please post a result from typing "sm version" in console?

Rothgar 11-15-2008 06:46

Re: AFK Manager
 
Quote:

Originally Posted by nbtc971 (Post 714000)
*edit*

Never mind, that was too negative so I'm removing it. I'll just say, sounds like a nice plugin, but i'm not moving off a STABLE release of sourcemod to install it. Thanks for your work however and I look forward to trying it out when 1.1 is final.

I am fairly certain 1.1 is never "stable" they use 1.1 as the development branch and once they get to a certain feature set they are happy with they create a new 1.0 branch version and name that as "stable"? At least that is my understanding of the new system of SourceMod releases?

If no-one uses 1.1 with the new bug fixes and feature updates then how will it ever progress? There are probably a number of changes that have even added additional support or fixed things for TF2 for example. I don't know which 1.1 "stable" release you are talking about because if you look on the SourceMod release page 1.1 does not exist. Then on the "snapshot" page latest I see is 2401?

Lebson506th 11-15-2008 12:54

Re: AFK Manager
 
Rothgar, that is hg2401. The SVN builds went up higher (2419 and up) before they switched to mercurial which added the "hg" before the build numbers.

retsam 11-15-2008 13:18

Re: AFK Manager
 
Yeah what he said. When you speak about SM builds you really need the to include the full name. 2401 is hg2401, thats way different from 1.1.0.2419.

You didnt note that in your post..... I guess that explains why it doesnt work at all or compile. You used code supported in only the mercurial snapshot versions.

So basically the first page should say it requires 1.1.0.hg2383 NOT 1.1.0.2383.

nbtc971 11-15-2008 16:03

Re: AFK Manager
 
When I say I'm waiting until 1.1 is final, I mean when you can download it as a finished, stable build that you can download from the stable releases download page. Currently the last stable release is 1.0.4. Of course if 1.1 never is released as a final build I'll just load the plugin on the next available stable release that this plugin will work with. Whether that's 1.0.5 or whatever, it's all good.

While I'm at it, assuming I ever load this plugin, which sounds nice, will it work for HL2DM? Thank you.

Lebson506th 11-15-2008 17:00

Re: AFK Manager
 
1.1.0 is the next release and it is close to release according to Bail.

Rothgar 11-15-2008 19:25

Re: AFK Manager
 
Hmm fair enough, odd that they changed the 1.1 branch like that so they don't match:

sm version for example shows:

21:38:04 SourceMod Version Information:
SourceMod Version: 1.1.0-dev
SourcePawn Engine: SourcePawn 1.1, jit-x86 (build 1.1.0-dev)
SourcePawn API: v1 = 4, v2 = 2
Compiled on: Oct 19 2008 00:50:38
Build ID: 2370:43b134b35542-dev
http://www.sourcemod.net/

Build ID is 2370 in this instance.

I will update the first post to reflect this and then I might try and upload a "compat" version or something which should run on the older release. If people want to try and use the move to spec option that might be another story I am not sure when the findteam function was implemented and people can manually add the semi-colon to the file as per https://bugs.alliedmods.net/show_bug.cgi?id=3376 if it does exist and you want to compile manually.

This plugin _Should_ work with any mod, that was my goal/idea anyway. Some mods won't be able to use the spectator feature due to not having a spectator team but for the ones that do I have tried to make that flexible/dynamic and not hard-coded to specific team ID's.

Rothgar 11-15-2008 23:08

Re: AFK Manager
 
Uploaded new "compat" version which should work with older versions of SourceMod maybe. let me know how it goes.

retsam 11-15-2008 23:34

Re: AFK Manager
 
Thx. Ill try it out.

nbtc971 11-16-2008 16:58

Re: AFK Manager
 
When you say 'older releases' are you including 1.0.4 or is this strictly for the development builds 1.1.xxx? I'd be happy to load it up and see how it works if you think it might on 1.0.4

Rothgar 11-17-2008 02:19

Re: AFK Manager
 
Quote:

Originally Posted by nbtc971 (Post 714690)
When you say 'older releases' are you including 1.0.4 or is this strictly for the development builds 1.1.xxx? I'd be happy to load it up and see how it works if you think it might on 1.0.4

Yes I just checked and it should work but it has the semi-colon issue when compiling which is addressed on the initial post under the Requirements section.

Liam 11-17-2008 11:11

Re: AFK Manager
 
That is a bug that was corrected in a recent release of the SM code compiler. So no, its not a problem anymore. Update your compiler.exe / spcomp.exe

nbtc971 11-17-2008 13:35

Re: AFK Manager
 
Well I downloaded your afk_manager-compat version however after attempting to load it I got this error:

Quote:

[SM] Plugin afk_manager-compat.smx failed to load: Native "VerifyCoreVersion" was not found..
I noticed you told someone else that the error apparently means you're not running the right version so I'm assuming this still doesn't work for 1.0.4.

Lebson506th 11-17-2008 13:49

Re: AFK Manager
 
Means it wasn't compiled on 1.0.4, try compiling it yourself.

nbtc971 11-17-2008 13:59

Re: AFK Manager
 
Quote:

Originally Posted by Lebson506th (Post 714972)
Means it wasn't compiled on 1.0.4, try compiling it yourself.

Ah yes, however now the semi colon problem will stick it's ugly head up. Exactly how can I get around it and still compile for 1.0.4? Do I need a fixed copy of "sdktools_stocks.inc"?

Never mind, I see I can just add the semi colon myself and recompile. Thanks.

Ok I got it compiled then uploaded to the server. After a server restart I tried "sm plugin list" and got this:

Quote:

Load Errors:
AFK Manager: Error detected in plugin startup (see error logs)
I looked in the error log and there wasn't much, but here is what it said:

Quote:

L 11/17/2008 - 14:21:57: SourceMod error session started
L 11/17/2008 - 14:21:57: Info (map "dm_runoff_9m") (file "errors_20081117.log")
L 11/17/2008 - 14:21:57: [SM] Native "CreateNative" reported: Fatal error creating dynamic native!
L 11/17/2008 - 14:21:57: [SM] Debug mode is not enabled for "irc-access.smx"
L 11/17/2008 - 14:21:57: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 30 on
L 11/17/2008 - 14:21:57: [SM] Native "IsClientInGame" reported: Client index 1 is invalid
L 11/17/2008 - 14:21:57: [SM] Debug mode is not enabled for "afk_manager-compat.smx"
L 11/17/2008 - 14:21:57: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 12 on
And apparently you can't turn debug on for a non-running plugin because I got this:

Quote:

13:31:34 [SM] Could not toggle debug mode on plugin afk_manager-compat.smx.
[SM] Plugin returned error: Plugin is not runnable.
Looks like the IsClientInGame is a problem for me. I have removed plugin for now.

nbtc971 11-17-2008 14:45

Re: AFK Manager
 
Ok the deleted post that says the reason is "Figured it out". Does not refer to my "IsClientInGame" problem. It was a totally unrelated problem. And now to avoid any confusion I have the last 3 posts which is exactly what I was trying to avoid however I didn't want any confusion. Sorry.


All times are GMT -4. The time now is 16:15.

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