jaszpol Posted December 22, 2012 Share Posted December 22, 2012 Hi, I would like to know whether it can be set to not flying two sounds at once on the server. Currently, he sits a few players on the server, and each player has to let go of it soudnpacka all overlap each other. Is it possible to make so that when you turn on the second musician to stop the first one to go? ;> Quote Link to comment Share on other sites More sharing options...
Management TheSilencerPL Posted December 24, 2012 Management Share Posted December 24, 2012 jaszpol is asking whether it is possible to not allow to play V-sounds at the same time. Quote Link to comment Share on other sites More sharing options...
Management TheSilencerPL Posted December 24, 2012 Management Share Posted December 24, 2012 There is no such setting at the moment.However what comes to my mind is something like this: we could make a cvar to enable time interval between certain type of soundswe could create/add the keyword to mark sounds with it in the .voice or .sounds files, e.g. nonparallel or something easier to spell if sound marked like this would be played it would be played only if the defined interval was ended. This would require admins to modify the sound files again, but would allow them to have this restriction only for certain type of sounds, for example music. Or we could use already existing keywords. Usually new sounds added in the soundpacks by admins don't have any keywords attached to the sound definition, while original voice chat messages have them, for example: "voice" keyword.So we could apply the interval restriction only to the sounds that do not have the "voice" keyword defined. Quote Link to comment Share on other sites More sharing options...
JvIasterMind Posted December 26, 2012 Share Posted December 26, 2012 This sounds like an interesting idea! I don't know much about those .voice and .sound files. I think it would be best to keep the configuration for server admins as simple as possible, which means to use the keywords that are already defined or setting a cvar like most other settings. Quote Link to comment Share on other sites More sharing options...
Management gaoesa Posted December 26, 2012 Management Share Posted December 26, 2012 Limiting vsay spamming is also possible with Lua scripting. -- List of vsays that are limited vsaylist = { [0] = "hi", [1] = "bye", -- insert new values here in lower case, edit nil element index too [2] = nil } -- The time when the previous vsay was execed exectimes = {} -- Minimum interval in milliseconds mininterval = 10000 function et_InitGame(levelTime, randomSeed, restart) et.RegisterModname("vsay spam limit script") end function VsayLimits(vsay) local levelTime = et.trap_Milliseconds() vsay = vsay:lower() -- all comparisons in lower case or players start circumventing local i = 0 while vsaylist[i] do if vsaylist[i] == vsay then if exectimes[i] and exectimes[i] > (levelTime - mininterval) then return 1 end exectimes[i] = levelTime return 0 end i = i + 1 end return 0 end -- Returns 1 if the command is intercepted. Note, do not use true or false. function et_ClientCommand( clientNum, cmd ) cmd = cmd:lower() -- lower case or players start circumventing if cmd == "vsay" then return VsayLimits(et.trap_Argv(1)) end return 0 end That is just an example how to intercept vsays. It is not exactly what was asked in the topic. This script instead limits each vsay separately. So that 10 seconds must pass before it can be played next time. However, it is simple to change the exectimes table of integer values to a single integer value. A better script would read the vsay list from some external file. Quote Link to comment Share on other sites More sharing options...
jaszpol Posted December 27, 2012 Author Share Posted December 27, 2012 The script works after testing it on the server, but for sure you can not do it in order to block global vsay not only for one user? Quote Link to comment Share on other sites More sharing options...
Management gaoesa Posted December 27, 2012 Management Share Posted December 27, 2012 I'm not sure if I understood the question. If you mean one person can vsay certain vsays only with specific interval? That is possible too. The et_ClientCommand has the client number as a parameter that can be used as the index to the exectimes instead of the i. Quote Link to comment Share on other sites More sharing options...
jaszpol Posted December 27, 2012 Author Share Posted December 27, 2012 I'm sorry that I do not understand but this wine translate. I meant to get around the server could not let go of any vsay twice. So one person lets go bye vsay this one may not exceed 10 seconds release the vsay hi or bye vsay. Quote Link to comment Share on other sites More sharing options...
jaszpol Posted December 27, 2012 Author Share Posted December 27, 2012 -- List of vsays that are limited vsaylist = { [0] = "kill_camper", [1] = "oh_camper", [2] = "scripts_camper", [3] = "cheater", [4] = "gameover", [5] = "gej", [6] = "Indi", [7] = "jesus", [8] = "narwhals", [9] = "pierdol", [10] = "poczekaj", [11] = "spac", [12] = "welcome2", [13] = "callpondem", [14] = "canttouchme", [15] = "girl", [16] = "godisadj", [17] = "gumis", [18] = "hwdP", [19] = "kochamcie", [20] = "manamana", [21] = "power", [22] = "1osiem", [23] = "sexy", [24] = "Skill", [25] = "techap", [26] = "tomsnare", [27] = "YMCA", [28] = "ahmed", [29] = "alestozjebal", [30] = "cisza", [31] = "donna", [32] = "doscwojny", [33] = "flaszke", [34] = "glupia", [35] = "haha4", [36] = "haha8", [37] = "jaspierdalam", [38] = "laugh3", [39] = "morgensonnenschein", [40] = "notgay", [41] = "przeklenstw", [42] = "reka", [43] = "shutup1", [44] = "umiecgrac", [45] = "uruguay", [46] = "wimiezasad", [47] = "wtf", [48] = "celantano", [49] = "destenation", [50] = "feel_this_moment", [51] = "gangnam", [52] = "hey_shorty", [53] = "milion_voices", [54] = "mykonos", [55] = "last_christmas", [56] = "pipi", [57] = "scream_shout", -- insert new values here in lower case, edit nil element index too [57] = nil } -- The time when the previous vsay was execed exectimes = {} -- Minimum interval in milliseconds mininterval = 10000 function et_InitGame(levelTime, randomSeed, restart) et.RegisterModname("vsay spam limit script") end function VsayLimits(vsay) local levelTime = et.trap_Milliseconds() vsay = vsay:lower() -- all comparisons in lower case or players start circumventing local i = 0 while vsaylist[i] do if vsaylist[i] == vsay then if exectimes[i] and exectimes[i] > (levelTime - mininterval) then return 1 end exectimes[i] = levelTime return 0 end i = i + 1 end return 0 end -- Returns 1 if the command is intercepted. Note, do not use true or false. function et_ClientCommand( clientNum, cmd, i ) cmd = cmd:lower() -- lower case or players start circumventing if cmd == "vsay" then return VsayLimits(et.trap_Argv(1)) end return 0 endWhat do I have to block the change globally? Quote Link to comment Share on other sites More sharing options...
Management gaoesa Posted December 27, 2012 Management Share Posted December 27, 2012 I'm still not sure. But here is 2 different alternate examples. This limits all the listed vsays with one time variable. -- List of vsays that are limited vsaylist = { [0] = "hi", [1] = "bye", -- insert newvalues here in lower case [2] = nil } -- The time when the previous vsay was execed exectime = 0 -- Minimum interval in milliseconds mininterval = 10000 function et_InitGame(levelTime, randomSeed, restart) et.RegisterModname("vsay spam limit script") end function VsayLimits(vsay) vsay = vsay:lower() -- all comparisons in lower case or the players start circumventing local i = 0 while vsaylist[i] do if vsaylist[i] == vsay then local levelTime = et.trap_Milliseconds() if exectime > (levelTime - mininterval) then return 1 end exectime = levelTime return 0 end i = i + 1 end return 0 end -- Returns 1 if the command is intercepted. Note, do not use true or false. function et_ClientCommand( clientNum, cmd ) cmd = cmd:lower() -- lower case or players start circumventing if cmd == "vsay" then return VsayLimits(et.trap_Argv(1)) end return 0 end This limits personal spam per client -- List of vsays that are limited vsaylist = { [0] = "hi", [1] = "bye", -- insert newvalues here in lower case [2] = nil } -- The time when the previous vsay was execed, per player exectimes = {} -- Minimum interval in milliseconds mininterval = 10000 function et_InitGame(levelTime, randomSeed, restart) et.RegisterModname("vsay spam limit script") end function VsayLimits(clientNum, vsay) vsay = vsay:lower() -- all comparisons in lower case or the players start circumventing local i = 0 while vsaylist[i] do if vsaylist[i] == vsay then local levelTime = et.trap_Milliseconds() if exectimes[clientNum] and exectimes[clientNum] > (levelTime - mininterval) then return 1 end exectimes[clientNum] = levelTime return 0 end i = i + 1 end return 0 end -- Returns 1 if the command is intercepted. Note, do not use true or false. function et_ClientCommand( clientNum, cmd ) cmd = cmd:lower() -- lower case or players start circumventing if cmd == "vsay" then return VsayLimits(clientNum, et.trap_Argv(1)) end return 0 end I also moved the et.trap_Milliseconds() to inside the matching condition, but it doesn't change the functionality in any way. Quote Link to comment Share on other sites More sharing options...
jaszpol Posted December 27, 2012 Author Share Posted December 27, 2012 ok, if it works first. Not exactly as I wanted but thank you very much for your help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.