PDA

View Full Version : autojoin fireteams via lua script?



NHLfan
3-01-2017, 22:33
Hi,
Is there a way to make players autojoin public fireteams?

a player connects to a server and the script searches for public fireteams which are not full (yet) and puts the player into the fireteam.
If there is no public fireteam, or the existing ones are already full -> create a new public fireteam and make the player join this one instread.

Is this possible via lua_script?
Is there already such a script, or a similar way to make players autojoin fireteams?

thanks in advance!

Timothy
13-01-2017, 08:41
This may be possible by checking and adjusting the configstrings. The fireteam configstrings (CS_FIRETEAMS) are typically at the end and contain the fireteam members formatted in a bitwise pattern. You can view configstring information on your server with the commands csinfo <id> (id is optional, it lists all strings). One such configstring may look like:


\id\0\l\0\p\0\c\0000000000000005

in which player slot 0 and slot 2 have occupied a place in the fireteam. Note that the id equals 0, which means that this is fireteam alpha and the leader is set to player slot 0. Check the leader's team by using entity information: sess.sessionTeam is your friend in this case. By checking his team you automatically know the fireteam's team as well.

You may also check my implementation for WolfAdmin for reference: click here (https://github.com/timosmit/wolfadmin/blob/develop/1.2.0/luascripts/game/fireteams.lua). It contains some functions to parse the configstring, but it doesn't allow editing. Lastly, I have not experienced with editing these configstrings so I do not know the effect of doing so; it might not work at all or have strange effects.

NHLfan
18-01-2017, 05:32
Hey there!
thanks for your reply.

I never did something in lua before and I tried to understand the documentaries, but unfortunately it's too much for me.