Jump to content

[HELP] Script


1LoL1

Recommended Posts

Posted

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 

Posted

from where you got ttt? i see setElementData and getElementData are the same

setElementData(player, "ttt", (getElementData(player, "ttt") or 0) + 1) 

Posted
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 

Posted
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.

Posted

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...

Posted
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) 

Posted
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?

Posted
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.

Posted

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.

Posted
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.

Posted

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?

Posted
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.

Posted

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) 

Posted
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.

Posted
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

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...