chore(coding-style): correct indentation

This commit is contained in:
Romain Lanz
2017-09-14 16:49:54 +02:00
parent aa394e1eb8
commit 4eb84d19eb
5 changed files with 65 additions and 56 deletions
+9
View File
@@ -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
+5 -5
View File
@@ -6,8 +6,8 @@ server_script "server.lua"
ui_page('html/index.html') ui_page('html/index.html')
files({ files({
'html/index.html', 'html/index.html',
'html/script.js', 'html/script.js',
'html/style.css', 'html/style.css',
'html/cursor.png' 'html/cursor.png',
}) })
+7 -7
View File
@@ -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 ====== --====== YOU CAN FIND ME ON MY DISCORD @Ark - https://discord.gg/cGHHxPX ======
--====== IF YOU ALTER THIS VERSION OF THE SCRIPT, PLEASE GIVE ME CREDIT ====== --====== IF YOU ALTER THIS VERSION OF THE SCRIPT, PLEASE GIVE ME CREDIT ======
--====== Special Thanks To COSHAREK FOR THE UI Design ====== --====== Special Thanks To COSHAREK FOR THE UI Design ======
@@ -45,11 +45,11 @@ end)
--== Register Callback == --== Register Callback ==
--=============================================== --===============================================
RegisterNUICallback('register', function(data, cb) RegisterNUICallback('register', function(data, cb)
myIdentity = data myIdentity = data
TriggerServerEvent('esx_identity:createIdentity', data) TriggerServerEvent('esx_identity:createIdentity', data)
EnableGui(false) EnableGui(false)
Wait (500) Wait (500)
TriggerEvent('esx_skin:openSaveableMenu') TriggerEvent('esx_skin:openSaveableMenu')
end) end)
--=============================================== --===============================================
@@ -73,4 +73,4 @@ Citizen.CreateThread(function()
end end
Citizen.Wait(0) Citizen.Wait(0)
end end
end) end)
+8 -8
View File
@@ -1,11 +1,11 @@
USE `essentialmode`; USE `essentialmode`;
CREATE TABLE `characters` ( CREATE TABLE `characters` (
`identifier` varchar(255) NOT NULL, `identifier` varchar(255) NOT NULL,
`firstname` varchar(255) NOT NULL, `firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL, `lastname` varchar(255) NOT NULL,
`dateofbirth` varchar(255) NOT NULL, `dateofbirth` varchar(255) NOT NULL,
`sex` varchar(1) NOT NULL DEFAULT 'f', `sex` varchar(1) NOT NULL DEFAULT 'f',
`height` varchar(128) NOT NULL `height` varchar(128) NOT NULL
); );
+36 -36
View File
@@ -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 ====== --====== YOU CAN FIND ME ON MY DISCORD @Ark - https://discord.gg/cGHHxPX ======
--====== IF YOU ALTER THIS VERSION OF THE SCRIPT, PLEASE GIVE ME CREDIT ====== --====== IF YOU ALTER THIS VERSION OF THE SCRIPT, PLEASE GIVE ME CREDIT ======
--====== Special Thanks To COSHAREK FOR THE UI Design ====== --====== 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", { local result = MySQL.Sync.fetchAll("SELECT * FROM characters WHERE identifier = @identifier", {
['@identifier'] = identifier ['@identifier'] = identifier
}) })
if result[1] ~= nil then if result[1] ~= nil then
local identity = result[1] local identity = result[1]
return { return {
firstname = identity['firstname'], firstname = identity['firstname'],
lastname = identity['lastname'], lastname = identity['lastname'],
dateofbirth = identity['dateofbirth'], dateofbirth = identity['dateofbirth'],
sex = identity['sex'], sex = identity['sex'],
height = identity['height'] height = identity['height']
} }
else else
return { return {
firstname = '', firstname = '',
lastname = '', lastname = '',
dateofbirth = '', dateofbirth = '',
sex = '', sex = '',
height = '' height = ''
} }
end end
end end
@@ -39,16 +39,16 @@ end
--== Create The Player's Identification == --== Create The Player's Identification ==
--=============================================== --===============================================
function createIdentity(identifier, data) function createIdentity(identifier, data)
MySQL.Sync.execute( MySQL.Sync.execute(
'INSERT INTO characters (identifier, firstname, lastname, dateofbirth, sex, height) VALUES (@identifier, @firstname, @lastname, @dateofbirth, @sex, @height)', 'INSERT INTO characters (identifier, firstname, lastname, dateofbirth, sex, height) VALUES (@identifier, @firstname, @lastname, @dateofbirth, @sex, @height)',
{ {
['@identifier'] = identifier, ['@identifier'] = identifier,
['@firstname'] = data.firstname, ['@firstname'] = data.firstname,
['@lastname'] = data.lastname, ['@lastname'] = data.lastname,
['@dateofbirth'] = data.dateofbirth, ['@dateofbirth'] = data.dateofbirth,
['@sex'] = data.sex, ['@sex'] = data.sex,
['@height'] = data.height ['@height'] = data.height
}) })
end end
--=============================================== --===============================================
@@ -63,11 +63,11 @@ end)
--== Player Loaded Event Handler == --== Player Loaded Event Handler ==
--=============================================== --===============================================
AddEventHandler('es:playerLoaded', function(source) AddEventHandler('es:playerLoaded', function(source)
local result = getIdentity(source) local result = getIdentity(source)
if result.firstname == '' then if result.firstname == '' then
Wait(500) Wait(500)
TriggerClientEvent('esx_identity:showRegisterIdentity', source) TriggerClientEvent('esx_identity:showRegisterIdentity', source)
else else
print('Player Has An Identity. Continuing.') print('Player Has An Identity. Continuing.')
end end
end) end)