Okay, how about you put a script, say "jv_bot_detect.cfg", into the .pk3 that you want clients to install; this script should do something you can detect happening on the server, like
(I'm assuming that if you can enter
in the console you can do it from a .cfg file)
Now, when you want to detect if a player has the .pk3 installed, do:
1.
Code: Select all
local.player stufftext exec jv_bot_detect.cfg
to execute the script (which won't execute, and hence won't start holding down USE, if the player doesn't have the .pk3)
2. perhaps you'll have to wait a moment for the action to occur - if the player has a 200ms ping I guess it might take 200ms, so perhaps it'd be safest to
here since I guess the
returns immediately rather than wait for the client to actually receive the command and execute it
3. check if the player is holding USE (
); if they are they probably have the .pk3 installed, but it could of course just be that they are opening a door/picking something up at that time, so it'd be best to do the check every now and then, and not only at the start of the round; if they do
not have USE held they almost certainly don't have the mod installed (or they are very lagged) so you could do a
message to that effect.
4. if they had USE held you should release it for them via
I'm not sure if this could interfere with the player doing things which require them to hold down USE for a while (e.g. those medic's packs I mentioned on TMT a while ago); if they are really holding down the USE key on their keyboard and we send
to their console, will it stuff them up?
Another thing you could do that is more difficult is to have the .cfg file do a
and then have an external program send an rcon to the server to do a
on each player once all the
Code: Select all
stufftext[code] commands have been sent; [code]my_pk3_installed : 1
(or something like that) should appear for every player that has the mod installed, and, for the rest, the external program should inform the script that it needs to send a message to that player (or it could do a
as console).
[Edit: So in summary, I guess you could say the first method is more likely to interfere with the player's game, but it's much easier since it doesn't require interfacing with an external program.
Also, sorry about the formatting with the code tags, I'll remember that they always cause a block display next time.]
Regards,
David