Sign in to follow this  
SkatCh

GetElementData problem

Recommended Posts

guyes let's take step by step :

i add this function to decrease time :(1s)

function decreaseMutedTime(player, time) 
    if (not isElement(player) or not time) then return end 
    local function decreaseTime() 
        local o = tonumber(getElementData(player, "mt")) or 0 <-----  this line 
        local time = o - 1 
        setElementData(player, "mt", getElementData(player, "mt") - 1) <-----  this line 
        if (time <= 1 and isPlayerMuted(player)) then 
            local time = nil 
            setElementData(player, "mt", false) 
            outputChatBox("You have been unmuted", player, 255, 255, 0) 
            setPlayerMuted(player, false) 
            setElementData(player, "muteInfo", false) 
            if (isTimer(unmuteTimer[player])) then 
                killTimer(unmuteTimer[player]) 
            end 
end 
end 
    unmuteTimer[player] = setTimer(decreaseTime, 1000, tonumber(getElementData(player, "mt"))) 
end 

then i add this to check mute time onPlayerLogout :

function checkMuteOnLogout(account) 
    if (not isPlayerMuted(source)) then return end 
    local mutedTime = getElementData(source, "mt") or 0 
    if (tonumber(mutedTime > 1)) then 
        setAccountData(account, "mt", tonumber(mutedTime)) 
    end 
end 
addEventHandler("onPlayerLogout", root, checkMuteOnLogout) 

the i add an other function to check mute onPlayerLogin :

function checkMuteOnLogin(account) 
    local mutedTime = getAccountData(account, "mt") or 0 
    if (tonumber(mutedTime > 1)) then 
        setPlayerMuted(source, true) 
        decreaseMutedTime(source, mutedTime) 
    end 
end 
addEventHandler("onPlayerLogin", root, checkMuteOnLogin) 

they are working fine but the problem now is when i mute someone and he leave the game i got this in my debugscript 3:

2ba5192464.jpg

Share this post


Link to post

The errors in line ?

and .. :

function checkMuteOnLogin(_,account) 
    local mutedTime = getAccountData(account, "mt") or 0 
    if (tonumber(mutedTime > 1)) then 
        setPlayerMuted(source, true) 
        decreaseMutedTime(source, mutedTime) 
    end 
end 
addEventHandler("onPlayerLogin", root, checkMuteOnLogin) 

and edit "onPlayerLogout" like this in Parameter

Share this post


Link to post

didn't work i try it, i think i need to kill the timer when the pleayer leave .

as I told you before, it is because you don't kill that timer when the player leaves.

Nor the table get cleaned.

but the problem how i tried many things and the same problem.

Share this post


Link to post
Why not using Serials? What if the player has no account? With a table.

bro it's working fine like that , just when the player leave the game i got some warnings , that's all , i restarted the resource it's working fine the player still muted , but when he leave the game an come back again , the mute time become 0.

can u help me

Share this post


Link to post

RE-PM

Bro please help me , i'm really sorry if i waste ur time but i think u are the only one can fix it please .

I am not the only one, but yes I can rewrite this code perfectly, but that isn't how it works.

I do not help people who are not trying to fix it by them self and who ignore my solutions. Also it looks like you don't know how your currently code works, so please leave me alone. I am not willing to help you under those conditions.

Share this post


Link to post
RE-PM
Bro please help me , i'm really sorry if i waste ur time but i think u are the only one can fix it please .

lol i tried ur solution and didn't work bulshit i think u don't know how to fix it i'm sorry if i asked ur for help really big difference between u and ET-win , he helped me many time also i PMed him and he directly post his answer here because he want to help people , but you u didn't even explaned to me how to use ur code ???? , more than that i don't need ur help don't post here again i'm pretty sure that i will someone will help me .

Players like you obliged the others to use leaked script's but i will never do this , and i will do my best to fix it.

Share this post


Link to post

hahaha, seems somebody doesn't like bad comments. Go a head and think that I can't, the scripters I have helped know better then that.

I probably have helped you also in the past. As you can see my post count then you know how many people I have helped.

Of course I am differed from my mate Et-win, but I let people write their own code and correct them when they made a mistake or give them solutions. In your case I gave a solution because of the leak of my time(large concept project). I did writing full code for people in the past, but I am not doing that any more and it seems he is still doing that on some topic's. It will probably change after he reached 2k posts.

Anyway it is really pathetic of you to compare me with Et-win so he will fix/rewrite your code.

and as you wished I will not reply on this, if you do not reply on this post. ( or I will still replying till you shut up :) )

I recommend you to not reply or you will literally ruining your own topic. Let Et-win write your code, I don't care less.

Share this post


Link to post

lol bla bla bla bla bulshit why you talk a lot ???? anyways i already fixed it hhhhhhhhhh , and i'm pretty sure that u can't fix it cya :P . really i can't stop hhhhhhhhhhhhhhhhhhhhhhhhhh

Topic can be locked thx guys for help.

Share this post


Link to post

That is why forums do exist, to do bla, bla, bla.... Looks like you haven't figured that out yet.

yes, topic can be locked, looks like he found it on the community.

Share this post


Link to post
That is why forums do exist, to do bla, bla, bla.... Looks like you haven't figured that out yet.

yes, topic can be locked, looks like he found it on the community.

problem fixed and he still talking hhhhhhhh .

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.