So I made a prop hunt server aprox two weeks ago.
On it I added PointShop points for Killing a prop, Survive as prop or taunting, but for tauting it’s a fixed value.
What I wanted to do is add more points when the taunt is longer. So I tried it in local and got this code that I added in the taunt function :
local tauntlength = math.ceil(SoundDuration(rand_taunt)) pl:PS_GivePoints(tauntlength) pl:PS_Notify("Vous avez obtenu " .. tauntlength .. " points pour avoir taunt!") -- this is the message the player gets.
rand_taunt is the taunt that is played (Ex : aph/alloyrun2.mp3, taunts/props/29.wav, …) and my file structure is like that : garrysmod/gamemodes/prop_hunt/content/sound/aph/<soundfiles> for my custom taunts (or taunts/props/<soundfiles> for default prop hunt taunts)
In local it works (The values the function return is most of the time shorter than the taunt but… Yeah I saw on this function desc that it doesn’t return corect value most of the time)
However, when I sent the file to my dedicated server, it doesn’t works, it always give 0 points…
In local :
On the server…
Is there something to do about this, or is SoundDuration not working on dedicated server ? :what:
Thanks for your ideas.