Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant buy Weapon license #36

Open
TheRealDadbeard opened this issue May 21, 2020 · 4 comments
Open

Cant buy Weapon license #36

TheRealDadbeard opened this issue May 21, 2020 · 4 comments

Comments

@TheRealDadbeard
Copy link

It will just error out. Totally forgot to make an issues and now have screenshots but I have the newest ESX and Licenses installed.

@sergio-atilano
Copy link

@TheRealDadbeard go to line 389 in server/main and replace if xPlayer.get('money') >= Config.LicensePrice then for if xPlayer.getMoney() >= Config.LicensePrice then

@TheRealDadbeard
Copy link
Author

TheRealDadbeard commented May 21, 2020

Thanks but it seems it can't fetch licences from the databse

SCRIPT ERROR: @esx_license/server/main.lua:72: attempt to index a nil value (field '?')

ref (@esx_license/server/main.lua:72)
(@mysql-async/mysql-async.js:15907)

it adds them correctly though.

I tried looking at other inventory plugins but really couldn't figure out the code as they are totally different in their approach.

Edit: Hmm now I get no error as I switched over to a new fixed kashacters but it still won't know that I have a license.

@TheRealDadbeard
Copy link
Author

This will let you buy and have your licence checked:

ESX.TriggerServerCallback('esx_license:checkLicense', function(hasWeaponLicense)
if hasWeaponLicense then
exports['mythic_notify']:DoHudText('error', _U('license_shop_check'))
else
OpenBuyLicenseMenu()
Citizen.Wait(2000)
end
end, GetPlayerServerId(PlayerId()), 'weapon')

I took this code from another much newer inventory script but which don't has the quickslots etc.

@bottlescript
Copy link

Same with me, anybody know how to solve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants