Erlkonig Posted May 18, 2021 Share Posted May 18, 2021 (edited) I tried to export function "aSetPlayerMuted" but got the debug "failed to call 'admin:aSetPlayerMuted' [string "?"], I don't give an anything what's wrong. Maybe I still did not realize how to use call function. I hope that someone will help cause I did not did anything since 2 litres a beer. Thanks everyone who will send something under. Code of the script: if str[1] == "/mute" then if str[2] and str[3] then if tonumber(str[3]) then local seconds = str[3] * 60 local thisPlayer = getPlayerFromName(str[2]) if thisPlayer then exports["admin"]:aSetPlayerMuted(thisPlayer, not isPlayerMuted (thisPlayer), seconds) I am sorry for the screen but this is the code from of the meta.xml I do not plan to sleep until I will fix it. The function of the admin-resource: function aSetPlayerMuted ( player, state, length ) if ( setPlayerMuted ( player, state ) ) then if not state then aRemoveUnmuteTimer( player ) elseif state and length and length > 0 then aAddUnmuteTimer( player, length ) end return true end return false end I'll be sorry if this is a very stupid mistake... Edited May 18, 2021 by Erlkonig Link to comment
Erlkonig Posted May 18, 2021 Author Share Posted May 18, 2021 (edited) Okay, after the beer is over I had realized that I had not restarted an "admin" resource. This is my fault. Sorry for this topic. The problem is solved. Also I am sorry because it was a very stupid mistake. I lost about 2 hours on this. Edited May 18, 2021 by Erlkonig Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now