Jump to content

Error: call: failed to call 'global:findPlayerByPartialNick'


Recommended Posts

Posted
function makemeAdmin(thePlayer, commandName, who, rank) 
        if not (who) then 
            outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Name/ID] [Rank]", thePlayer, 255, 194, 14) 
        else 
            local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, who) 
             
            if (targetPlayer) then 
                local username = getPlayerName(thePlayer) 
                local accountID = getElementData(targetPlayer, "gameaccountid") 
                 
                exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "adminlevel", tonumber(rank)) 
                 
                rank = tonumber(rank) 
                 
                if (rank<1337) then 
                    exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "hiddenadmin", 0) 
                end 
                 
                local query = mysql:query_free("UPDATE accounts SET admin='" .. mysql:escape_string(tonumber(rank)) .. "', hiddenadmin='0' WHERE id='" .. mysql:escape_string(accountID) .. "'") 
                outputChatBox("You set " .. targetPlayerName .. "'s Admin rank to " .. rank .. ".", thePlayer, 0, 255, 0) 
                 
                local hiddenAdmin = getElementData(thePlayer, "hiddenadmin") 
                 
                -- Fix for scoreboard & nametags 
                local targetAdminTitle = exports.global:getPlayerAdminTitle(targetPlayer) 
                if (rank>0) or (rank==-999999999) then 
                    exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "adminduty", 1) 
                else 
                    exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "adminduty", 0) 
                end 
                mysql:query_free("UPDATE accounts SET adminduty=" .. mysql:escape_string(getElementData(targetPlayer, "adminduty")) .. " WHERE id = " .. mysql:escape_string(getElementData(targetPlayer, "gameaccountid")) ) 
                exports.global:updateNametagColor(targetPlayer) 
                 
                if (hiddenAdmin==0) then 
                    local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) 
                    outputChatBox(adminTitle .. " " .. username .. " set your admin rank to " .. rank .. ".", targetPlayer, 255, 194, 14) 
                else 
                    outputChatBox("Hidden admin set your admin rank to " .. rank .. ".", targetPlayer, 255, 194, 14) 
                end 
            end 
        end 
    end 
end 
addCommandHandler("makemeadmin", makemeAdmin, false, false)       

Posted
This guy should stop using vgScripts and make his own GameMode(If he can).

Hey You stupid stop jumping into things this is the shodown script i could just type that up that doesnt mean its from vG Nub

Posted

ShoDown is Valhalla... it's just edits of the vgscript I downloaded the code and the vg 3.0.2 code I looked into the Global and Account System also SQL and many resources they do have valhalla scripts in there the new scripts by the owner are self made but only a few.

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