diff --git a/esx_kashacters/server/main.lua b/esx_kashacters/server/main.lua index f9cfa653..204aef5e 100644 --- a/esx_kashacters/server/main.lua +++ b/esx_kashacters/server/main.lua @@ -62,11 +62,11 @@ AddEventHandler('kashactersS:CharacterChosen', function(charid, ischar) SetLastCharacter(src, tonumber(charid)) SetCharToIdentifier(GetRockstarID(src), tonumber(charid)) - if ischar == "true" then + if ischar == true then new = false spawn = GetSpawnPos(src) else - TriggerClientEvent('skinchanger:loadDefaultModel', src, true, cb) + TriggerClientEvent('skinchanger:loadDefaultModel', src, true, cb) spawn = { x = 195.55, y = -933.36, z = 29.90 } -- DEFAULT SPAWN POSITION end @@ -84,26 +84,26 @@ AddEventHandler('kashactersS:DeleteCharacter', function(charid) end) function GetPlayerCharacters(source) - local Chars = MySQLAsyncExecute("SELECT * FROM `users` WHERE identifier LIKE '%"..GetIdentifierWithoutLicense(GetRockstarID(source)).."%'") - for i = 1, #Chars, 1 do - charJob = MySQLAsyncExecute("SELECT * FROM `jobs` WHERE `name` = '"..Chars[i].job.."'") - charJobgrade = MySQLAsyncExecute("SELECT * FROM `job_grades` WHERE `grade` = '"..Chars[i].job_grade.."' AND `job_name` = '"..Chars[i].job.."'") - local accounts = json.decode(Chars[i].accounts) - Chars[i].bank = accounts["bank"] - Chars[i].money = accounts["money"] - Chars[i].job = charJob[1].label - if charJob[1].label == "Unemployed" then - Chars[i].job_grade = "" - else - Chars[i].job_grade = charJobgrade[1].label + local Chars = MySQLAsyncExecute("SELECT * FROM `users` WHERE identifier LIKE '%"..GetIdentifierWithoutLicense(GetRockstarID(source)).."%'") + for i = 1, #Chars, 1 do + charJob = MySQLAsyncExecute("SELECT * FROM `jobs` WHERE `name` = '"..Chars[i].job.."'") + charJobgrade = MySQLAsyncExecute("SELECT * FROM `job_grades` WHERE `grade` = '"..Chars[i].job_grade.."' AND `job_name` = '"..Chars[i].job.."'") + local accounts = json.decode(Chars[i].accounts) + Chars[i].bank = accounts["bank"] + Chars[i].money = accounts["money"] + Chars[i].job = charJob[1].label + if charJob[1].label == "Unemployed" then + Chars[i].job_grade = "" + else + Chars[i].job_grade = charJobgrade[1].label + end + if Chars[i].sex == "m" then + Chars[i].sex = "Male" + else + Chars[i].sex = "Female" + end end - if Chars[i].sex == "m" then - Chars[i].sex = "Male" - else - Chars[i].sex = "Female" - end - end - return Chars + return Chars end function GetLastCharacter(source) diff --git a/readme.md b/readme.md index 430a1ea6..40a9fc36 100644 --- a/readme.md +++ b/readme.md @@ -93,4 +93,7 @@ end) So when you are choosing your character it changes your **Rockstar license** which is normally **license:** to **Char:** this prevents ESX from loading another character because it is looking for you exact license. So when you choose your character it will change it from Char: to your normal Rockstar license (license:). When creating a new character it will spawn you without an exact license which creates a new database entry for your license. ## Multiple languages support -Just change locales/en.js in html/ui.html (line 10) \ No newline at end of file +Just change locales/en.js in html/ui.html (line 10) + + +![img](https://gyazo.com/9ec7181c10679e4053ced5349884f4e8) \ No newline at end of file