FiveEYZ / esx_kashacter

esx_kashacters fixed for latest version of ESX.
https://github.com/KASHZIN/kashacters
13 stars 30 forks source link

commands for esx are nolonger working when esx_kashacter is installed #27

Open captainbritian opened 4 years ago

captainbritian commented 4 years ago

i installed the mod and followed the steps i belive that it has to do with the permission system in es_extended not likeing haveing multi toons

commands like /car are just saying access denied desipte being an admin heck even as set as super admin they still will not be allowed to be used i think the main reason why is due to the way you identify players in this mod

GatorTank2123 commented 3 years ago

any luck with this

sort72 commented 3 years ago

I finally fixed it. This is just what you have to do:

Change this code in onPlayerJoined(playerId) function on two places:

    for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
        if string.match(v, 'license:') then
            identifier = string.sub(v, 9)
            break
        end
    end

to:

    for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
        if string.match(v, 'license:') then
            identifier = v
            break
        end
    end

DON'T DO IT!

Just let it as it was originally:

identifier = string.sub(v, 9)

And replace this line:

local Chars = MySQLAsyncExecute("SELECT * FROM `users` WHERE identifier LIKE '%"..GetIdentifierWithoutLicense(GetRockstarID(source)).."%'")

To:

local Chars = MySQLAsyncExecute("SELECT * FROM `users` WHERE identifier LIKE '%"..(GetRockstarID(source)).."%'")

Finally just simply replace this in the same file:

function GetIdentifierWithoutLicense(Identifier)
    return string.gsub(Identifier, "license", "")
end

To this:

function GetIdentifierWithoutLicense(Identifier)
    return ':' .. Identifier
end

There you go. I hope it works for you.