Jump to content

[HELP] AP


1LoL1

Recommended Posts

When i want to set "setgamespeed" or other functions i have this error i don't know how to fix. Please can anyone fix this?:

_getPlayerName = getPlayerName 
function getPlayerName(player) 
if get("hexRemove") == "true" then 
if string.find(_getPlayerName(player), "#%x%x%x%x%x%x") then 
    return string.gsub(_getPlayerName(player), "#%x%x%x%x%x%x", "") 
else 
    return _getPlayerName(player) 
end 
else 
    return _getPlayerName(player) 
end 
end 

ERROR: 61: bad argument #1 to "find" (string expected, got boolean)

WARNING: 61: Bad argument @ "getPlayerName" [Expected element at argument 1, got boolean]

Link to comment

You're calling getPlayerName with a boolean value.

Add an if statement to make sure that the player argument is an element:

_getPlayerName = getPlayerName 
function getPlayerName(player) 
if (not isElement(player) or getElementType(player) ~= 'player') then return end 
if get("hexRemove") == "true" then 
if string.find(_getPlayerName(player), "#%x%x%x%x%x%x") then 
    return string.gsub(_getPlayerName(player), "#%x%x%x%x%x%x", "") 
else 
    return _getPlayerName(player) 
end 
else 
    return _getPlayerName(player) 
end 
end 

Link to comment

Solved i fixed but now i have here warnings :( :

WARNING: 42: Bad argument @ "guiCheckBoxGetSelected" [Expected gui-element at argument 1, got nil]

WARNING: 355: Bad argument @ "guiCheckBoxGetSelected" [Expected gui-element at argument 1, got nil]

Line (42): if ( ( destroy ) or ( guiCheckBoxGetSelected ( aPerformanceInput ) ) ) then

Line (355): if ( ( destroy ) or ( guiCheckBoxGetSelected ( aPerformanceInput ) ) ) then

Please can anyone fix this?

Link to comment
The admin panel itself works fine and doesn't spit out such errors, so you either have it edited or you messed up something.

all work but i dont know why not work "Player has been unmuted by "Console"

function aAction ( type, action, admin, player, data, more ) 
    if ( aLogMessages[type] ) then 
        function aStripString ( string ) 
            local adminNick = string.gsub(getPlayerName ( admin ), "#%x%x%x%x%x%x","") -- Line (541) 
            local playerNick = string.gsub(getPlayerName ( player ), "#%x%x%x%x%x%x","") 
            string = tostring ( string ) 
            string = string.gsub ( string, "$admin", adminNick ) 
            string = string.gsub ( string, "$by_admin_4all", isAnonAdmin4All( admin )    and "" or " " .. adminNick ) 
            string = string.gsub ( string, "$by_admin_4plr", isAnonAdmin4Victim( admin ) and "" or " " .. adminNick ) 
            string = string.gsub ( string, "$data2", more or "" ) 
            if ( player ) then string = string.gsub ( string, "$player", playerNick )  end 
            return tostring ( string.gsub ( string, "$data", data or "" ) ) 
        end 
        local node = aLogMessages[type][action] 
        if ( node ) then 
            local r, g, b = node["r"], node["g"], node["b"] 
            if ( node["all"] ) then outputChatBox ( aStripString ( node["all"] ), _root, r, g, b, true ) end 
            if ( node["admin"] ) and ( admin ~= player ) then outputChatBox ( aStripString ( node["admin"] ), admin, r, g, b, true ) end 
            if ( node["player"] ) then outputChatBox ( aStripString ( node["player"] ), player, r, g, b, true ) end 
            if ( node["log"] ) then outputServerLog ( aStripString ( node["log"] ) ) end 
        end 
    end 
end 

ERROR: 541: bad argument #1 to "gsub" (string expected, got nil)

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