diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..4bfca33b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 2 +indent_style = space +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/__resource.lua b/__resource.lua index b5ede11b..42c2dec2 100644 --- a/__resource.lua +++ b/__resource.lua @@ -6,8 +6,8 @@ server_script "server.lua" ui_page('html/index.html') files({ - 'html/index.html', - 'html/script.js', - 'html/style.css', - 'html/cursor.png' -}) \ No newline at end of file + 'html/index.html', + 'html/script.js', + 'html/style.css', + 'html/cursor.png', +}) diff --git a/client.lua b/client.lua index 5e85a9e2..086e995c 100644 --- a/client.lua +++ b/client.lua @@ -1,5 +1,5 @@ --================================================================================== ---====== ESX_IDENTITY BY ARKSEYONET @Ark ====== +--====== ESX_IDENTITY BY ARKSEYONET @Ark ====== --====== YOU CAN FIND ME ON MY DISCORD @Ark - https://discord.gg/cGHHxPX ====== --====== IF YOU ALTER THIS VERSION OF THE SCRIPT, PLEASE GIVE ME CREDIT ====== --====== Special Thanks To COSHAREK FOR THE UI Design ====== @@ -45,11 +45,11 @@ end) --== Register Callback == --=============================================== RegisterNUICallback('register', function(data, cb) - myIdentity = data - TriggerServerEvent('esx_identity:createIdentity', data) - EnableGui(false) - Wait (500) - TriggerEvent('esx_skin:openSaveableMenu') + myIdentity = data + TriggerServerEvent('esx_identity:createIdentity', data) + EnableGui(false) + Wait (500) + TriggerEvent('esx_skin:openSaveableMenu') end) --=============================================== @@ -73,4 +73,4 @@ Citizen.CreateThread(function() end Citizen.Wait(0) end -end) \ No newline at end of file +end) diff --git a/esx_identity.sql b/esx_identity.sql index cdc60abb..4e6aa28c 100644 --- a/esx_identity.sql +++ b/esx_identity.sql @@ -1,11 +1,11 @@ USE `essentialmode`; - + CREATE TABLE `characters` ( - `identifier` varchar(255) NOT NULL, - `firstname` varchar(255) NOT NULL, - `lastname` varchar(255) NOT NULL, - `dateofbirth` varchar(255) NOT NULL, - `sex` varchar(1) NOT NULL DEFAULT 'f', - `height` varchar(128) NOT NULL -); \ No newline at end of file + `identifier` varchar(255) NOT NULL, + `firstname` varchar(255) NOT NULL, + `lastname` varchar(255) NOT NULL, + `dateofbirth` varchar(255) NOT NULL, + `sex` varchar(1) NOT NULL DEFAULT 'f', + `height` varchar(128) NOT NULL +); diff --git a/server.lua b/server.lua index a0e4208e..8cedd197 100644 --- a/server.lua +++ b/server.lua @@ -1,5 +1,5 @@ --================================================================================== ---====== ESX_IDENTITY BY ARKSEYONET @Ark ====== +--====== ESX_IDENTITY BY ARKSEYONET @Ark ====== --====== YOU CAN FIND ME ON MY DISCORD @Ark - https://discord.gg/cGHHxPX ====== --====== IF YOU ALTER THIS VERSION OF THE SCRIPT, PLEASE GIVE ME CREDIT ====== --====== Special Thanks To COSHAREK FOR THE UI Design ====== @@ -14,24 +14,24 @@ function getIdentity(source) local result = MySQL.Sync.fetchAll("SELECT * FROM characters WHERE identifier = @identifier", { ['@identifier'] = identifier }) - if result[1] ~= nil then - local identity = result[1] - - return { - firstname = identity['firstname'], - lastname = identity['lastname'], - dateofbirth = identity['dateofbirth'], - sex = identity['sex'], - height = identity['height'] - } - else - return { - firstname = '', - lastname = '', - dateofbirth = '', - sex = '', - height = '' - } + if result[1] ~= nil then + local identity = result[1] + + return { + firstname = identity['firstname'], + lastname = identity['lastname'], + dateofbirth = identity['dateofbirth'], + sex = identity['sex'], + height = identity['height'] + } + else + return { + firstname = '', + lastname = '', + dateofbirth = '', + sex = '', + height = '' + } end end @@ -39,16 +39,16 @@ end --== Create The Player's Identification == --=============================================== function createIdentity(identifier, data) - MySQL.Sync.execute( - 'INSERT INTO characters (identifier, firstname, lastname, dateofbirth, sex, height) VALUES (@identifier, @firstname, @lastname, @dateofbirth, @sex, @height)', - { - ['@identifier'] = identifier, - ['@firstname'] = data.firstname, - ['@lastname'] = data.lastname, - ['@dateofbirth'] = data.dateofbirth, - ['@sex'] = data.sex, - ['@height'] = data.height - }) + MySQL.Sync.execute( + 'INSERT INTO characters (identifier, firstname, lastname, dateofbirth, sex, height) VALUES (@identifier, @firstname, @lastname, @dateofbirth, @sex, @height)', + { + ['@identifier'] = identifier, + ['@firstname'] = data.firstname, + ['@lastname'] = data.lastname, + ['@dateofbirth'] = data.dateofbirth, + ['@sex'] = data.sex, + ['@height'] = data.height + }) end --=============================================== @@ -63,11 +63,11 @@ end) --== Player Loaded Event Handler == --=============================================== AddEventHandler('es:playerLoaded', function(source) - local result = getIdentity(source) - if result.firstname == '' then - Wait(500) - TriggerClientEvent('esx_identity:showRegisterIdentity', source) - else - print('Player Has An Identity. Continuing.') - end + local result = getIdentity(source) + if result.firstname == '' then + Wait(500) + TriggerClientEvent('esx_identity:showRegisterIdentity', source) + else + print('Player Has An Identity. Continuing.') + end end)