Jump to content

[HELP] Script


1LoL1

Recommended Posts

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 

Link to comment
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.

Link to comment

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.

Link to comment
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.

Link to comment
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.

Link to comment
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

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...