Skip to content

Commit

Permalink
Merge pull request #545 from bitpredator/dev
Browse files Browse the repository at this point in the history
[esx_license\server\main.lua]: Replaced print in esx_license:addLicense
  • Loading branch information
bitpredator authored Oct 17, 2023
2 parents 6a77d38 + 94cf6d6 commit e82ddeb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
8 changes: 7 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
[esx_property\client\main.lua]: add copy to clipboard to /getoffset @bitpredator
[esx_property\locales\en.lua & it.lua]: corrected typos @bitpredator
[esx_property\server\main.lua]: correction of lint errors @bitpredator
[esx_property\config.lua]: correction of lint errors @bitpredator
[esx_property\config.lua]: correction of lint errors @bitpredator
3. [esx_license\server\main.lua]: Replaced print in esx_license:addLicense
[esx_license\fxmanifest.lua]: Update fxmanifest.lua to version 1.0.0
[esx_license\README.md]: update reference links in README.md
[esx_license\LICENSE]: updates the copyright reference year

4 changes: 2 additions & 2 deletions server-data/resources/[esx_addons]/esx_license/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

esx_license
Copyright (C) 2015-2022 Jérémie N'gadi
Copyright (C) 2015-2023 Jérémie N'gadi

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

esx_license Copyright (C) 2015-2022 Jérémie N'gadi
esx_license Copyright (C) 2015-2023 Jérémie N'gadi
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
6 changes: 3 additions & 3 deletions server-data/resources/[esx_addons]/esx_license/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

### Using [fvm](https://github.com/qlaffont/fvm-installer)
```
fvm install --save --folder=esx esx-org/esx_license
fvm install --save --folder=esx esx-framework/esx_license
```

### Using Git
```
cd resources
git clone https://github.com/ESX-Org/esx_license [esx]/esx_license
git clone https://github.com/esx-framework/esx_license [esx]/esx_license
```

### Manually
- Download https://github.com/ESX-Org/esx_license/archive/master.zip
- Download https://github.com/esx-framework/esx_license/archive/master.zip
- Put it in the `[esx]` directory

## Installation
Expand Down
4 changes: 2 additions & 2 deletions server-data/resources/[esx_addons]/esx_license/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ fx_version 'adamant'
game 'gta5'

description 'ESX License'

version '0.0.4'
lua54 'yes'
version '1.0.0'

server_scripts {
'@es_extended/imports.lua',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ local function isValidLicense(licenseType)
return flag
end

RegisterNetEvent('esx_license:addLicense')
AddEventHandler('esx_license:addLicense', function(target, licenseType, cb)
local xPlayer = ESX.GetPlayerFromId(target)
if xPlayer then
if isValidLicense(licenseType) then
AddLicense(xPlayer.getIdentifier(), licenseType, cb)
else
print('[esx_license] : missing license type in db ' .. licenseType .. ' or someone try to use lua executor id : ' .. target)
print(('[esx_license]: Missing license type in db ^5%s^0 or someone try to use lua executor ID: ^5%s^0'):format(licenseType, target))
end
end
end)
Expand Down

0 comments on commit e82ddeb

Please sign in to comment.