Ulysses

Ulysses Stuff => Releases => Topic started by: Fanney on June 27, 2014, 11:49:43 AM

Title: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: Fanney on June 27, 2014, 11:49:43 AM
Oi' mates, today I wanna present you my shiny addon.

This addon allows you to add fancy join messages and sounds in seconds!

It's a bit more advanced so it supports GeoIP (showing location in messages) & sounds (playing them on join / left) and it's group based it also supports the common admin addons.

Without further talking, the addon is still simple.
Just copy the extracted folder in your addons folder and here you go, some groups are already set-up.

If you want to add your own groups then you can go ahead and examine the config file which is located at "advjoinleave\lua\autorun\server\ss_advjl_config.lua"

How to add group or modify groups?
It's simple, first open the config file.

Then you'll find this in a table:
Code: [Select]
{
    groupnames = {"superadmin", "admin", "operator"}, -- Group(s) which will use the message.
    receivers = nil, -- This is a list of groups which will receive the messages.
    resolvegeodata = true, -- If you want to resolve geo data for this message (REQUIRED FOR GEO-IP RELEATED MESSAGES!)

    sounds = {
        join = "",
        leave = ""
    },

    messages = {
        join = "#FFFFFF[#9C7878JOIN:#FFFFFF] !playername! joined our server from #FFFFFF[#9C7878!countryCode!#FFFFFF]",
        leave = "#FFFFFF[#9C7878LEFT:#FFFFFF] !playername![!steamid!] left us."
    }
},

Now, this is the template for the admin groups you can easily copy that and modify it to suit your needs just take care that you don't forget to add a ", (semicolon)" at the end of every line if one follows after.

If we want every in the group "donator" to play a sound located in the "sound/advjl" folder then we need to make it look like that:
Code: [Select]

{
    groupnames = {"donator"}, -- Group(s) which will use the message.
    receivers = nil, -- This is a list of groups which will receive the messages.
    resolvegeodata = true, -- If you want to resolve geo data for this message (REQUIRED FOR GEO-IP RELEATED MESSAGES!)

    sounds = {
        join = "donatorjoin.wav",
        leave = ""
    },

    messages = {
        join = "#FFFFFF[#9C7878JOIN:#FFFFFF] !playername! joined our server from #FFFFFF[#9C7878!countryCode!#FFFFFF]",
        leave = "#FFFFFF[#9C7878LEFT:#FFFFFF] !playername![!steamid!] left us."
    }
},
The rest should be pretty clear.

Changelog:
20/5/2016- Refactored a bit (code looks less ugly now)
- Added multi-group support
- Added message receivers (a list of groups which should receive the join message useful for admin only messages)
11/2/2014
- Added Multicolor support.
- Added a way to add more information to the messages.
11/14/2014
- Fixed "#" in names causing the message to not show.
- Added Muting of sounds on mapchange.

Download(s):
Github (newest Version) (https://codeload.github.com/myudev/gmod_addons/zip/advjoinleave)
Github (for contributions) (https://github.com/myudev/gmod_addons/tree/advjoinleave)
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP) !ALPHA!
Post by: Storm on June 29, 2014, 06:13:59 AM
Can this be configured for different groups? For example i don't want it displayed when admins join or leave.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP) !ALPHA!
Post by: Fanney on June 29, 2014, 01:06:08 PM
Can this be configured for different groups? For example i don't want it displayed when admins join or leave.
You can just keep "messageformat" and "messageformatdc" blank.

You can find the config in this Folder ("addons\advjoinleave\lua\autorun\server\ss_advjl_config.lua")

Just edit those two:
Code: [Select]
{groupname="superadmin", playsound="superadminjoin.wav", leftsound="", messageformat="[JOIN:] %s our shiny Owner from [%s] connected!", messageformatdc="[DISCONNECT:] %s left us!", resolvecountry=true},
{groupname="admin", playsound="adminjoin.wav", leftsound="",  messageformat="[JOIN:] %s our shiny Admin from [%s] connected!", messageformatdc="[DISCONNECT:] %s left us!", resolvecountry=true},
   
to
Code: [Select]
{groupname="superadmin", playsound="", leftsound="", messageformat="", messageformatdc="", resolvecountry=false},
{groupname="admin", playsound="", leftsound="",  messageformat="", messageformatdc="", resolvecountry=false},
Title: Broken?
Post by: Marz on July 03, 2014, 01:11:46 AM
This is broken for me when I try extract it.

If you could re-upload or upload else where I would love you.

-Lewis
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP) !ALPHA!
Post by: JamminR on July 03, 2014, 01:35:01 AM
Marz, file extracts for me and many others just fine.
What program are you trying to use to extract it?
What do you mean "broken"? What errors?
Sounds like a PC program or internet issue, nothing to do with the link/hosted file.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP) !ALPHA!
Post by: Fanney on July 03, 2014, 06:45:54 AM
Marz, file extracts for me and many others just fine.
What program are you trying to use to extract it?
What do you mean "broken"? What errors?
Sounds like a PC program or internet issue, nothing to do with the link/hosted file.
It's some nasty problem with WinRAR or other programs, i packed the file with 7zip's ultra compression.

New packed version in attachments.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: Fanney on July 11, 2014, 12:37:05 PM
I updated the addon and fixed a rare NULL ENTITY error, also i re-formatted the config abit.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: Dawnkiller on July 13, 2014, 01:40:50 AM
This looks great, looking forward to putting this on my server!

However one problem, I can't find the sounds anywhere. I've looked in the folder and it's empty for me.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: Fanney on July 13, 2014, 06:40:06 AM
However one problem, I can't find the sounds anywhere. I've looked in the folder and it's empty for me.
Sounds are not included by default, if you want to put some in then put them there (addons/advjoinleav/sound/advjl) and add the soundname in the config under either playsound or leftsound.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: eagle9er9er on July 18, 2014, 08:03:00 PM
Doesn't work for me, I added the folder to addons, edited the config a little bit and nothing shows up in chat when people join. No errors, no messages, nothing.

Edit: So it works when people leave, but this is the error when people join.

Lua Error: [ERROR] addons/advjoinleave/lua/autorun/server/ss_advjl.lua:186: bad argument #1 to 'Simple' (number expected, got nil) 1. Simple - [C]:-1 2. fn - addons/advjoinleave/lua/autorun/server/ss_advjl.lua:186 3. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: Fanney on July 21, 2014, 01:59:12 AM
Doesn't work for me, I added the folder to addons, edited the config a little bit and nothing shows up in chat when people join. No errors, no messages, nothing.

Edit: So it works when people leave, but this is the error when people join.

Lua Error: [ERROR] addons/advjoinleave/lua/autorun/server/ss_advjl.lua:186: bad argument #1 to 'Simple' (number expected, got nil) 1. Simple - [C]:-1 2. fn - addons/advjoinleave/lua/autorun/server/ss_advjl.lua:186 3. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
Sorry for late Response, should be fixed in the lastest Download
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: eagle9er9er on July 21, 2014, 08:35:43 PM
Sorry for late Response, should be fixed in the lastest Download

Thanks so much this addon is awesome.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: dylanr423 on July 29, 2014, 08:53:22 PM
There is no sound folder? Help?
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: Fanney on July 30, 2014, 06:55:13 AM
There is no sound folder? Help?
Just create the Folder in addons\advjoinleave\
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: ChaosWolf on August 28, 2014, 07:47:41 AM
Straight to the point.

[ERROR] addons/advjoinleave/lua/autorun/server/ss_advjl.lua:9: '=' expected near 'local'
  1. unknown - addons/advjoinleave/lua/autorun/server/ss_advjl.lua:0


Lua Code Lines 1-15
Code: Lua
  1. methin--[[
  2.         Advanced Join & Leave Messages Supporting Sounds & GEOPIP for ULX
  3.         Written by Fannney' or also known as MyU
  4.         Contact:
  5.                 Skype: myudev
  6.                 Mail: myudev0@googlemail.com
  7.                 Steam: [url]http://steamcommunity.com/id/fannney/[/url]
  8. ]]
  9. local iGroupTableSize = 0 -- well it's not that huge of a performance hit for counting a table entries but who cares right?
  10. local iDefaultID = 0
  11. local netMsgStr = "advjl_info"
  12.  
  13. if not advjl_msgdelay then
  14.         include ( "ss_advjl_config.lua" )
  15. end

the funny thing is, lua line 9 has what its looking for... yet I'm still getting an error. so I figured I would bring it here.
for some reason this error is causing it not to work at all. as in no text when joining/leaving and no sound. even though its been configured properly, and the sound directory is sound/advjl as stated above.

any thoughts as to how to fix this?
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: Neku on August 28, 2014, 08:45:47 AM
I don't know what "methin' is on top of your posted code, but try to remove it and try again.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: ChaosWolf on August 28, 2014, 02:27:24 PM
There's that sharp eye again, thanks Neku that did the trick, though, im not sure why it called for an '=' rather then calling a nil value lua:1:

feel free to disregard its only my curiosity as I am still a modest amateur in regards to lua.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: JamminR on August 28, 2014, 11:36:03 PM
Geez, I saw that too and thought it was a "methinks" not intended inside the BB code tag.
You actually had it in your lua file? Wow.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: Neku on August 28, 2014, 11:40:40 PM
Geez, I saw that too and thought it was a "methinks" not intended inside the BB code tag.
You actually had it in your lua file? Wow.

As soon as we assume...  ;)
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: ChaosWolf on August 28, 2014, 11:41:55 PM
so should I start begging for forgivness now orrrrr???
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: axeboy1778 on September 17, 2014, 03:30:04 AM
Constantly getting an error now instead of fetching the GeoIP, anyone know why? [Game] Jake connected from ERR!
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: Fanney on September 19, 2014, 12:11:47 PM
Constantly getting an error now instead of fetching the GeoIP, anyone know why? [Game] Jake connected from ERR!
Is your Server probably blocking outside calls?
Maybe your server can't access ip-api.com it's been and is working fine for me
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: axeboy1778 on September 19, 2014, 09:28:19 PM
It has previously worked, not sure what changed. It just stopped working.

EDIT: I stand corrected, it has since started working. No idea why it stopped working for a while.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: Fanney on September 20, 2014, 05:56:54 AM
It has previously worked, not sure what changed. It just stopped working.

EDIT: I stand corrected, it has since started working. No idea why it stopped working for a while.
You can add some debug by editing advjoinleave / lua / autorun / server / ss_advjl.lua.
Search for -- Request was successful
and add following:
Code: [Select]
ServerLog("Response data:" .. data .. "\n")
then it should look like
Code: [Select]
-- Request was successful
ServerLog("Response data:" .. data .. "\n")

Then just connect and paste the output, or maybe it'll return a error that says something.
Title: Re: Advanced Join and Leave 0.1 (Supporting Sounds, Messages, GeoIP)
Post by: Fanney on November 15, 2014, 11:54:05 AM
Keeping up with my changes:

Update 1:
Updated, my favorite update!

I've added multi color support via hex colors and support for multiplie parameters to output more information.

You're now able to display more than before on disconnect and join, you can display following things:
Code: [Select]
GEO-IP releated:
!zip!             - Player's zip code, most likely it's empty.
!country!         - Player's country like "Germany".
!countryCode!     - Player's country code like "DE".
!query!         - The IP of the requested info.
!city!             - Player's city.
!org!             - Player's ISP organisation.
!region!         - Player's regions short code like "WEYWTIT" (ok abit shorter).
!lat!             - Player's latitude like "48.75".
!timezone!         - Player's timezone like "Europe/Berlin".
!isp!             - Player's ISP like "mediaways".
!regionName!     - Player's region name like "whateveryouwanttoinsethere".

player releated:
!playername!     - Player's name.
!group!         - Player's current group like "superadmin".
!steamid!         - Player's Steam ID like "STEAM_0:0:37706701".

The new default's will now look like:
(http://i.san-mp.de/i/4355E4.png)

Everything you need is in the config, it should be self-explanatory.

Main Post got updated.
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: Shalmendo on November 18, 2014, 02:16:05 PM
Okay so..this is proabably a more general garry's mod question, but i think it applies here as well.

What format do sounds need to be in?
(I'm sure I put them in the right folder)
do you have to put the .wav extension at the end in the 'sound' setting for each of the groups?
how do you make sure the clients download the sounds so they can be played? (or do they have to?)
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: Fanney on November 21, 2014, 12:55:27 PM
In the addons/advjoinleave/sounds folder.
If it doesn't exists create one, and you need to add the extension like (.wav,.mp3 etc)
The Script automatically adds them to the client download list if added in the config.
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: Luk | twitch.tv/doctorluk on January 16, 2015, 08:27:58 AM
Hello, I'm getting an error when a player gets kicked by the server when using reserved slots. This is the actual kick reason:
Code: [Select]
L 01/16/2015 - 15:48:45: "gaben<1720><STEAM_xxxxxxxx><>" disconnected (reason "[ULX] Reserved slot, sorry!")
and this is the error:

Code: [Select]
[ERROR] addons/advjoinleave/lua/autorun/server/ss_advjl.lua:128: bad argument #1 to 'pairs' (table expected, got nil)
   2. advjl_ShowDisconnectMessage - addons/advjoinleave/lua/autorun/server/ss_advjl.lua:128
    3. advjl_PreHandleJoinLeftMessage - addons/advjoinleave/lua/autorun/server/ss_advjl.lua:213
     4. fn - addons/advjoinleave/lua/autorun/server/ss_advjl.lua:237
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: Fanney on January 16, 2015, 11:48:19 AM
Hello, I'm getting an error when a player gets kicked by the server when using reserved slots. This is the actual kick reason:
Code: [Select]
L 01/16/2015 - 15:48:45: "gaben<1720><STEAM_xxxxxxxx><>" disconnected (reason "[ULX] Reserved slot, sorry!")
and this is the error:

Code: [Select]
[ERROR] addons/advjoinleave/lua/autorun/server/ss_advjl.lua:128: bad argument #1 to 'pairs' (table expected, got nil)
   2. advjl_ShowDisconnectMessage - addons/advjoinleave/lua/autorun/server/ss_advjl.lua:128
    3. advjl_PreHandleJoinLeftMessage - addons/advjoinleave/lua/autorun/server/ss_advjl.lua:213
     4. fn - addons/advjoinleave/lua/autorun/server/ss_advjl.lua:237

Fixed please redownload it from github (the link at the start post)
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: allofmywutsteam on April 07, 2015, 06:51:38 PM
In the addons/advjoinleave/sounds folder.
If it doesn't exists create one, and you need to add the extension like (.wav,.mp3 etc)
The Script automatically adds them to the client download list if added in the config.

1. Does it need to be in the 'sound' or 'sounds' folder? You switched it up right there for a second. I'm going to assume 'sound' since that's whats started in the config

2. I have my sound 'pop.mp3' in the playsound config, I have the file in addons/advjoinleave/sound/advjl/pop.mp3, and I even synced my FTP to ensure its hosted. But the sound doesn't play. All other text-based changes showed up immediately, but would this one require a reboot?

The sound in question: http://monicasnwo.site.nfoservers.com/server/sound/advjl/pop.mp3 (http://monicasnwo.site.nfoservers.com/server/sound/advjl/pop.mp3)
Config in question: http://puu.sh/h5yW0/54240d8e32.png (http://puu.sh/h5yW0/54240d8e32.png)

Think I just needed to reboot because I heard it last night. Great addon!
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: allofmywutsteam on April 09, 2015, 06:30:32 PM
1. Does it need to be in the 'sound' or 'sounds' folder? You switched it up right there for a second. I'm going to assume 'sound' since that's whats started in the config

2. I have my sound 'pop.mp3' in the playsound config, I have the file in addons/advjoinleave/sound/advjl/pop.mp3, and I even synced my FTP to ensure its hosted. But the sound doesn't play. All other text-based changes showed up immediately, but would this one require a reboot?

The sound in question: http://monicasnwo.site.nfoservers.com/server/sound/advjl/pop.mp3 (http://monicasnwo.site.nfoservers.com/server/sound/advjl/pop.mp3)
Config in question: http://puu.sh/h5yW0/54240d8e32.png (http://puu.sh/h5yW0/54240d8e32.png)

Think I just needed to reboot because I heard it last night. Great addon!

Trying a new sound.

1. Added to server and synced to webserver
2. added file name "batman.mp3" to file
3. rebooted server using !restart command with timer

Do I need to reboot directly from console to ensure it works immediately? The pop.mp3 audio plays. Not sure why the inconsistency.

Audio: http://monicasnwo.site.nfoservers.com/server/sound/advjl/batman.mp3 (http://monicasnwo.site.nfoservers.com/server/sound/advjl/batman.mp3)
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: allofmywutsteam on April 10, 2015, 03:47:43 PM
Any assistance?
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: Caustic Soda-Senpai on April 10, 2015, 04:58:22 PM
is it FastDL'd and give an AddResource() in lua/autorun ?
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: allofmywutsteam on April 10, 2015, 05:15:13 PM
is it FastDL'd and give an AddResource() in lua/autorun ?

Is the Audio file FastDL'd? Nope. The audio randomly started working thougfh,. After two days. And it's not downloaded. Neither is the pop sound, but everyone can hear that
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: heavyblood on April 25, 2015, 12:54:55 PM
Is i t possible to rename countries that join? For instance America -> USA
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: Fanney on July 06, 2016, 03:41:23 PM
I updated this addon a while ago, mainly to fix my crappy English.
But I also refactored the config and added some things as some peoples are using it.

Changelog:
20/5/2016
- Refactored a bit (code looks less ugly now)
- Added multi-group support
- Added message receivers (a list of groups which should receive the join message useful for admin only messages)
- Added a way to mute sounds/msgs on map change to avoid spam.
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: allofmywutsteam on December 21, 2018, 11:05:29 AM
My OP:

Quote
ULib v..263
ULX v..373

Game mode(s) I am having this problem on: TTT

I installed Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!, but I want to remove this default (green) loading text. I'm not sure where in the settings (addon or server side) that it needs to be removed.

The text shows when a user CONNECTS to the server (seen in console) rather than joins the server (as intended by the addon).

(https://i.imgur.com/PDtxH8T.png)

Replying to my own thread that's locked.

Quote
You already asked in the proper release thread.
Please do not double post.
Additionally, This forum section is intended for Team Ulysses project help/discussion only.
That release was by a community member.

If the original author or anyone stopping by that release knows the answer, perhaps they will help.

EDIT - The original release has example showing - it's in the template config file.
Use hex color codes. Or presume set leave/join to "".
Original topic - https://forums.ulyssesmod.net/index.php/topic,7367.15.html
Github file (but you'd edit locally) - https://github.com/myudev/gmod_addons/blob/advjoinleave/advjoinleave/lua/autorun/server/ss_advjl_config.lua

Jammin - I was warned about the old-ness of this thread and whether or not it's worth reviving, so I wasn't sure if I should create a new thread. Regarding this addon, I'm nto sure you understood what I was referring to.

I currently have 2 join messages going on. 1 from the addon (the text that says [Bye]), but then there's the other text that it is in green - which does not come from the addon. So I wasn't sure if my problem was specific to this addon since that green join text was happening even when I deleted this addon. So I would get the join message coming from console (before the player is actually in the server - shown in green) and then when they're in the server, I get a second join message from the addon (which is the one I wish to keep).

Leaving the join/leave fields blank in the addon (1) won't offer the join/leave message I want, and (2) won't remove the join message I don't want. I'm thinking it has to do with a default ttt setting, but I'm not sure where to find the setting, so I was hoping someone else may have some insight.

Edit: Also, sorry for posting in the wrong section. I'll await a response here (hopefully).
Edit: here's a better example. Green text applies when they first connect to server, and then grey text shows when theyre physically in the server.

(https://i.imgur.com/FqV6bm5.png)
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: JamminR on December 21, 2018, 09:14:43 PM
I'm pretty sure that first text is standard Gmod/Source server, not an addon.
You might be able to prevent it by returning "" with (http://wiki.garrysmod.com/favicon.ico) GM:PlayerConnect (http://wiki.garrysmod.com/page/GM/PlayerConnect)

The 'hi' is likely the addon.
Title: Re: Advanced Join and Leave (Supporting Sounds, Messages, GeoIP, Multi Coloring!)
Post by: allofmywutsteam on December 22, 2018, 05:12:27 AM
I'm pretty sure that first text is standard Gmod/Source server, not an addon.
You might be able to prevent it by returning "" with (http://wiki.garrysmod.com/favicon.ico) GM:PlayerConnect (http://wiki.garrysmod.com/page/GM/PlayerConnect)

The 'hi' is likely the addon.

Yes, the 'hi' is the addon, and the green text is not the addon. I just wasn't sure how to stop the green text from happening. I will give the playerconnect, but would you mind pointing me towards where I should be adding this? Thank you!