[HELP] GetGroupID

FaNNboii

Member
Joined
Oct 16, 2015
Messages
15
Reaction score
4
Points
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
Joined
Apr 30, 2015
Messages
933
Reaction score
1,014
Points
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:

FaNNboii

Member
Joined
Oct 16, 2015
Messages
15
Reaction score
4
Points
35
can you maybe post a code? im a newbie sry :P
 

Derp

Retired Staff
Contributor
Joined
Apr 30, 2015
Messages
933
Reaction score
1,014
Points
217
can you maybe post a code? im a newbie sry :p
If you want to code a plugin then you'll have to do it yourself. I showed you the way. Just be creative and think of how it can be done :P
 

Bluscream

Retired Staff
Contributor
Joined
May 8, 2015
Messages
967
Reaction score
934
Points
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
Joined
Oct 16, 2015
Messages
15
Reaction score
4
Points
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 -.-
 

FaNNboii

Member
Joined
Oct 16, 2015
Messages
15
Reaction score
4
Points
35
Ok, i figured it out!
Now i want to mute all Clients local when i join a server!
how is it possible?
@Bluscream @skokkk
 
Last edited:
Top