1LoL1 Posted October 5, 2015 Posted October 5, 2015 Hello please can anyone fix this? i don't know why this not working. 0 errors 0 warnings function ttt (player,action) if (action == "mute") then setElementData(player, "ttt", (getElementData(player, "ttt") or 0) + 1) end end
KariiiM Posted October 5, 2015 Posted October 5, 2015 from where you got ttt? i see setElementData and getElementData are the same setElementData(player, "ttt", (getElementData(player, "ttt") or 0) + 1)
1LoL1 Posted October 5, 2015 Author Posted October 5, 2015 from where you got ttt? i see setElementData and getElementData are the same setElementData(player, "ttt", (getElementData(player, "ttt") or 0) + 1) This is full code. function ttt (player,action) if (action == "mute") then setElementData(player, "ttt", (getElementData(player, "ttt") or 0) + 1) end end
Buffalo Posted October 6, 2015 Posted October 6, 2015 Noone is able to help you, it's only a fragment code that tells us nothing. Post more code how ttt is called and how you want it to work
1LoL1 Posted October 6, 2015 Author Posted October 6, 2015 Noone is able to help you, it's only a fragment code that tells us nothing. Post more code how ttt is called and how you want it to work When player is muted or get muted he get 1x ttt.
KariiiM Posted October 6, 2015 Posted October 6, 2015 When player is muted or get muted he get 1x ttt. From where you got the data ttt ? so show us the code
1LoL1 Posted October 7, 2015 Author Posted October 7, 2015 When player is muted or get muted he get 1x ttt. From where you got the data ttt ? so show us the code What? omg when player get mute he get 1x ttt...
xeon17 Posted October 7, 2015 Posted October 7, 2015 The event onPlayerMute is exactly that what you need.
1LoL1 Posted October 7, 2015 Author Posted October 7, 2015 The event onPlayerMute is exactly that what you need. Thanks work but when i unmuted player i have 2x ttt function ttt () setElementData(source, "ttt", (getElementData(source, "ttt") or 0) + 1) end addEventHandler("onPlayerMute", getRootElement(), ttt)
ozulus Posted October 7, 2015 Posted October 7, 2015 function unmute() setElementData(source, "ttt", 0) end addEventHandler("onPlayerUnmute", root, unmute)
xeon17 Posted October 7, 2015 Posted October 7, 2015 There is also a event for that called onPlayerUnmute. You should check the wiki before asking for such help
1LoL1 Posted October 7, 2015 Author Posted October 7, 2015 function unmute() setElementData(source, "ttt", 0) end addEventHandler("onPlayerUnmute", root, unmute) But this is not what i want and how i can cancelled event onPlayerUnmute?
ozulus Posted October 7, 2015 Posted October 7, 2015 You can use cancelEvent(). Also i don't understand exactly what you want
1LoL1 Posted October 7, 2015 Author Posted October 7, 2015 You can use cancelEvent(). Also i don't understand exactly what you want i know what is cancelEvent() but i don't know how i can use in this script ._. i want to when player get mute he get 1x ttt but when i use /mute name and /unmute name he get too 1x ttt <-- and this i don't want.
ozulus Posted October 7, 2015 Posted October 7, 2015 Why do you want to use cancelEvent() ? These are enough for you. function mute () setElementData(source, "ttt", (getElementData(source, "ttt") or 0) + 1) end addEventHandler("onPlayerMute", getRootElement(), mute) function unmute() setElementData(source, "ttt", 0) end addEventHandler("onPlayerUnmute", root, unmute) important note This note for onPlayerMute If this event is canceled, the player will not be muted. This one for onPlayerUnmute If this event is canceled, the player will not be unmuted.
1LoL1 Posted October 7, 2015 Author Posted October 7, 2015 Why do you want to use cancelEvent() ? These are enough for you. function mute () setElementData(source, "ttt", (getElementData(source, "ttt") or 0) + 1) end addEventHandler("onPlayerMute", getRootElement(), mute) function unmute() setElementData(source, "ttt", 0) end addEventHandler("onPlayerUnmute", root, unmute) important note This note for onPlayerMute If this event is canceled, the player will not be muted. This one for onPlayerUnmute If this event is canceled, the player will not be unmuted. omg this is not what i want you read my post? when player get mute so get 1x ttt but when i use /unmute player he get 1x ttt too and this i don't want i want only when player get mute.
ozulus Posted October 7, 2015 Posted October 7, 2015 Are you using your own mute system or default admin script's mute system? If you are using own script, please show the codes. Also did you try codes which i wrote?
1LoL1 Posted October 7, 2015 Author Posted October 7, 2015 Are you using your own mute system or default admin script's mute system? If you are using own script, please show the codes. Also did you try codes which i wrote? Default admin mute system.
BluntZ Posted October 9, 2015 Posted October 9, 2015 What error it is showing actually ? What you want to do with it ?
HUNGRY:3 Posted October 9, 2015 Posted October 9, 2015 not sure what do you mean but try this lol function poop () setElementData(source, "ttt", (getElementData(source, "ttt") or 0) + 1) end addEventHandler("onPlayerMute", getRootElement(),poop)
1LoL1 Posted October 9, 2015 Author Posted October 9, 2015 not sure what do you mean but try this lol function poop () setElementData(source, "ttt", (getElementData(source, "ttt") or 0) + 1) end addEventHandler("onPlayerMute", getRootElement(),poop) this work but when i use /unmute i have too get 1x ttt i want only when player is muted not unmuted.
Best-Killer1 Posted October 10, 2015 Posted October 10, 2015 function poop () setElementData(source, "ttt", (getElementData(source, "ttt") or 0) + 1) setElementData(source, "ttt", (getElementData(source, "ttt") or 0) + 0) end addEventHandler("onPlayerMute", getRootElement(),poop) addEventHandler("onPlayerUnMute", getRootElement(),poop) try that i'm not sure about it work or no
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