[HELP] GetGroupID

FaNNboii

Member
Oct 16, 2015
15
4
35
Hey, i wanted to code a Plugin where i listen to chat and only if a special Servergroup write something in Chat, my Plugin answer!
So i need to get the ServergroupID. How i get it?
I tried: local grps, error = ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, ts3defs.ClientProperties.CLIENT_SERVERGROUPS)

but it dont work.

Can anyone help pls?
 
Last edited:

Derp

Retired Staff
Contributor
Apr 30, 2015
933
1,014
217
Hey, i wanted to code a Plugin where i listen to chat and only if a special Servergroup write something in Chat, my Plugin answer!
So i need to get the ServergroupID. How i get it?
I tried: ocal grps, error = ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, ts3defs.ClientProperties.CLIENT_SERVERGROUPS)

but it dont work.

Can anyone help pls?
Hook the Server/Client Chat Message event. Then read the user's uID. After that get the user's dbid from the uID and read the list of the assigned servergroups. After that scan the populated buffer and see if it contains the server group id you want.

Edit: Some help:
Hook the Send Message event
Code:
ts3plugin_onTextMessageEvent(uint64 serverConnectionHandlerID, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored);

Get dbID from uID
Code:
unsigned int (*requestClientDBIDfromUID)(uint64 serverConnectionHandlerID, const char* clientUniqueIdentifier, const char* returnCode);

Get server groups using the user's dbID
Code:
unsigned int (*requestServerGroupsByClientID)(uint64 serverConnectionHandlerID, uint64 clientDatabaseID, const char* returnCode);
 
Last edited:

Bluscream

Retired Staff
Contributor
May 8, 2015
967
934
211
Code:
local groups = ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, ts3defs.ClientProperties.CLIENT_SERVERGROUPS)
should work but you have to convert the string into a array. Going to test it after i woke up.
 

FaNNboii

Member
Oct 16, 2015
15
4
35
Code:
local groups = ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, ts3defs.ClientProperties.CLIENT_SERVERGROUPS)
should work but you have to convert the string into a array. Going to test it after i woke up.

can you maybe tell me how i convert string to a array in lua? dont find anything in google -.-
 
Top