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
+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 ======
--====== 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)