SkatCh

Members
  • Content Count

    366
  • Joined

  • Last visited

Posts posted by SkatCh


  1. Hello there ,

    i create a new ban system with a special view etc ... but the problem is how can i check the player serial before he press the login button . so which one i need to use "onPlayerJoin" or "onPlayerConnect". i tried this but didn't work .

    function checkBan() 
        for index, ban in pairs(banList) do 
        local serial = getPlayerSerial (source) 
            if (ban[1] == serial) then 
                triggerClientEvent(source, "showBanScreen", source,ban[1],ban[2], ban[3], ban[4]) 
            end 
        end 
    end 
    addEventHandler ( "onPlayerJoin", getRootElement(), checkBan ) 
    

    banList -- special Table like getBans()


  2. You mean like this :

    function timerDetails(source) 
        if (isTimer(antiSpamAds[source])) then 
            remaining = getTimerDetails(antiSpamAds[source]) 
            outputChatBox("Time remaining "..remaining.." seconds .",source,153,51,255) 
        else 
            outputChatBox("Timer no longer exists",source,153,51,255) 
        end 
    end 
    addCommandHandler("time", timerDetails) 
    

    -- Save Timer

    function save() 
    local PlayerAccount = getPlayerAccount ( source ) 
    local AccountName = getAccountName (PlayerAccount) 
    if ( AccountName ) then 
    setAccountData ( playeraccount,  "time", remaining ) 
      end 
    end 
    addEventHandler ("onPlayerQuit", root, save ) 
    


  3. Hi, please i need some help can anyone tell me how can i check the timer if it's inside a table.

    like this :

    local timer = {} 
      
    function ()  
    bla  
    bla  
    antiSpamAds[source] = setTimer(function() end, 900000, 1 ) 
      
    etc.... 
    end 
    

    Now how can i use this :

    function timerDetails() 
        remaining = getTimerDetails(........) ----- What do i write here ? 
        if (remaining) then 
            outputChatBox("Time remaining "..remaining.." seconds .",source,153,51,255) 
        else  
            outputChatBox("Timer no longer exists",source,153,51,255) 
        end 
    end 
    addCommandHandler("time", timerDetails) 
    


  4. guys please i need some help i create a vip system and i want to keep the time working even if the player logout is that possible .

    just a part from my script:

    local timers = { }

    function startTime ( thePlayer ) 
        if not ( timers [ thePlayer ] ) then 
            timers [ thePlayer ] = setTimer ( function () 
                    if ( isElement ( thePlayer ) ) then 
                        local timeLeft = getElementData ( thePlayer, "time" ); 
                        if ( timeLeft ) then 
                            if ( timeLeft > 0 ) then 
                                if ( ( timeLeft - 1 ) > 0 ) then 
                                    setElementData ( thePlayer, "time", timeLeft - 1 ); 
                                else 
                                    remove ( thePlayer ); 
                                end 
                            else 
                                remove ( thePlayer ); 
                            end 
                        end 
                    else 
                        return; 
                    end 
                end, 1000, -1 
            );       
        end 
    end 
    


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


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


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


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


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