mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Cleanup, improved chat suggestions
This commit is contained in:
+3
-3
@@ -86,9 +86,9 @@ end)
|
|||||||
Citizen.CreateThread(function()
|
Citizen.CreateThread(function()
|
||||||
while true do
|
while true do
|
||||||
if guiEnabled then
|
if guiEnabled then
|
||||||
DisableControlAction(0, 1, guiEnabled) -- LookLeftRight
|
DisableControlAction(0, 1, true) -- LookLeftRight
|
||||||
DisableControlAction(0, 2, guiEnabled) -- LookUpDown
|
DisableControlAction(0, 2, true) -- LookUpDown
|
||||||
DisableControlAction(0, 106, guiEnabled) -- VehicleMouseControlOverride
|
DisableControlAction(0, 106, true) -- VehicleMouseControlOverride
|
||||||
DisableControlAction(0, 142, true) -- MeleeAttackAlternate
|
DisableControlAction(0, 142, true) -- MeleeAttackAlternate
|
||||||
DisableControlAction(0, 30, true) -- MoveLeftRight
|
DisableControlAction(0, 30, true) -- MoveLeftRight
|
||||||
DisableControlAction(0, 31, true) -- MoveUpDown
|
DisableControlAction(0, 31, true) -- MoveUpDown
|
||||||
|
|||||||
+225
-241
@@ -1,191 +1,186 @@
|
|||||||
function getIdentity(source, callback)
|
function getIdentity(source, callback)
|
||||||
local identifier = GetPlayerIdentifiers(source)[1]
|
local identifier = GetPlayerIdentifiers(source)[1]
|
||||||
MySQL.Async.fetchAll("SELECT * FROM `users` WHERE `identifier` = @identifier",
|
|
||||||
{
|
MySQL.Async.fetchAll("SELECT * FROM `users` WHERE `identifier` = @identifier",
|
||||||
['@identifier'] = identifier
|
{
|
||||||
},
|
['@identifier'] = identifier
|
||||||
function(result)
|
}, function(result)
|
||||||
if result[1]['firstname'] ~= nil then
|
if result[1]['firstname'] ~= nil then
|
||||||
local data = {
|
local data = {
|
||||||
identifier = result[1]['identifier'],
|
identifier = result[1]['identifier'],
|
||||||
firstname = result[1]['firstname'],
|
firstname = result[1]['firstname'],
|
||||||
lastname = result[1]['lastname'],
|
lastname = result[1]['lastname'],
|
||||||
dateofbirth = result[1]['dateofbirth'],
|
dateofbirth = result[1]['dateofbirth'],
|
||||||
sex = result[1]['sex'],
|
sex = result[1]['sex'],
|
||||||
height = result[1]['height']
|
height = result[1]['height']
|
||||||
}
|
}
|
||||||
|
callback(data)
|
||||||
callback(data)
|
else
|
||||||
else
|
local data = {
|
||||||
local data = {
|
identifier = '',
|
||||||
identifier = '',
|
firstname = '',
|
||||||
firstname = '',
|
lastname = '',
|
||||||
lastname = '',
|
dateofbirth = '',
|
||||||
dateofbirth = '',
|
sex = '',
|
||||||
sex = '',
|
height = ''
|
||||||
height = ''
|
}
|
||||||
}
|
|
||||||
|
callback(data)
|
||||||
callback(data)
|
end
|
||||||
end
|
end)
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function getCharacters(source, callback)
|
function getCharacters(source, callback)
|
||||||
local identifier = GetPlayerIdentifiers(source)[1]
|
local identifier = GetPlayerIdentifiers(source)[1]
|
||||||
MySQL.Async.fetchAll("SELECT * FROM `characters` WHERE `identifier` = @identifier",
|
MySQL.Async.fetchAll("SELECT * FROM `characters` WHERE `identifier` = @identifier",
|
||||||
{
|
{
|
||||||
['@identifier'] = identifier
|
['@identifier'] = identifier
|
||||||
},
|
}, function(result)
|
||||||
function(result)
|
if result[1] and result[2] and result[3] then
|
||||||
if result[1] and result[2] and result[3] then
|
local data = {
|
||||||
local data = {
|
identifier = result[1]['identifier'],
|
||||||
identifier = result[1]['identifier'],
|
firstname1 = result[1]['firstname'],
|
||||||
firstname1 = result[1]['firstname'],
|
lastname1 = result[1]['lastname'],
|
||||||
lastname1 = result[1]['lastname'],
|
dateofbirth1 = result[1]['dateofbirth'],
|
||||||
dateofbirth1 = result[1]['dateofbirth'],
|
sex1 = result[1]['sex'],
|
||||||
sex1 = result[1]['sex'],
|
height1 = result[1]['height'],
|
||||||
height1 = result[1]['height'],
|
firstname2 = result[2]['firstname'],
|
||||||
firstname2 = result[2]['firstname'],
|
lastname2 = result[2]['lastname'],
|
||||||
lastname2 = result[2]['lastname'],
|
dateofbirth2 = result[2]['dateofbirth'],
|
||||||
dateofbirth2 = result[2]['dateofbirth'],
|
sex2 = result[2]['sex'],
|
||||||
sex2 = result[2]['sex'],
|
height2 = result[2]['height'],
|
||||||
height2 = result[2]['height'],
|
firstname3 = result[3]['firstname'],
|
||||||
firstname3 = result[3]['firstname'],
|
lastname3 = result[3]['lastname'],
|
||||||
lastname3 = result[3]['lastname'],
|
dateofbirth3 = result[3]['dateofbirth'],
|
||||||
dateofbirth3 = result[3]['dateofbirth'],
|
sex3 = result[3]['sex'],
|
||||||
sex3 = result[3]['sex'],
|
height3 = result[3]['height']
|
||||||
height3 = result[3]['height']
|
}
|
||||||
}
|
|
||||||
|
callback(data)
|
||||||
|
elseif result[1] and result[2] and not result[3] then
|
||||||
|
local data = {
|
||||||
|
identifier = result[1]['identifier'],
|
||||||
|
firstname1 = result[1]['firstname'],
|
||||||
|
lastname1 = result[1]['lastname'],
|
||||||
|
dateofbirth1 = result[1]['dateofbirth'],
|
||||||
|
sex1 = result[1]['sex'],
|
||||||
|
height1 = result[1]['height'],
|
||||||
|
firstname2 = result[2]['firstname'],
|
||||||
|
lastname2 = result[2]['lastname'],
|
||||||
|
dateofbirth2 = result[2]['dateofbirth'],
|
||||||
|
sex2 = result[2]['sex'],
|
||||||
|
height2 = result[2]['height'],
|
||||||
|
firstname3 = '',
|
||||||
|
lastname3 = '',
|
||||||
|
dateofbirth3 = '',
|
||||||
|
sex3 = '',
|
||||||
|
height3 = ''
|
||||||
|
}
|
||||||
|
|
||||||
callback(data)
|
callback(data)
|
||||||
elseif result[1] and result[2] and not result[3] then
|
elseif result[1] and not result[2] and not result[3] then
|
||||||
local data = {
|
local data = {
|
||||||
identifier = result[1]['identifier'],
|
identifier = result[1]['identifier'],
|
||||||
firstname1 = result[1]['firstname'],
|
firstname1 = result[1]['firstname'],
|
||||||
lastname1 = result[1]['lastname'],
|
lastname1 = result[1]['lastname'],
|
||||||
dateofbirth1 = result[1]['dateofbirth'],
|
dateofbirth1 = result[1]['dateofbirth'],
|
||||||
sex1 = result[1]['sex'],
|
sex1 = result[1]['sex'],
|
||||||
height1 = result[1]['height'],
|
height1 = result[1]['height'],
|
||||||
firstname2 = result[2]['firstname'],
|
firstname2 = '',
|
||||||
lastname2 = result[2]['lastname'],
|
lastname2 = '',
|
||||||
dateofbirth2 = result[2]['dateofbirth'],
|
dateofbirth2 = '',
|
||||||
sex2 = result[2]['sex'],
|
sex2 = '',
|
||||||
height2 = result[2]['height'],
|
height2 = '',
|
||||||
firstname3 = '',
|
firstname3 = '',
|
||||||
lastname3 = '',
|
lastname3 = '',
|
||||||
dateofbirth3 = '',
|
dateofbirth3 = '',
|
||||||
sex3 = '',
|
sex3 = '',
|
||||||
height3 = ''
|
height3 = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(data)
|
callback(data)
|
||||||
elseif result[1] and not result[2] and not result[3] then
|
else
|
||||||
local data = {
|
local data = {
|
||||||
identifier = result[1]['identifier'],
|
identifier = '',
|
||||||
firstname1 = result[1]['firstname'],
|
firstname1 = '',
|
||||||
lastname1 = result[1]['lastname'],
|
lastname1 = '',
|
||||||
dateofbirth1 = result[1]['dateofbirth'],
|
dateofbirth1 = '',
|
||||||
sex1 = result[1]['sex'],
|
sex1 = '',
|
||||||
height1 = result[1]['height'],
|
height1 = '',
|
||||||
firstname2 = '',
|
firstname2 = '',
|
||||||
lastname2 = '',
|
lastname2 = '',
|
||||||
dateofbirth2 = '',
|
dateofbirth2 = '',
|
||||||
sex2 = '',
|
sex2 = '',
|
||||||
height2 = '',
|
height2 = '',
|
||||||
firstname3 = '',
|
firstname3 = '',
|
||||||
lastname3 = '',
|
lastname3 = '',
|
||||||
dateofbirth3 = '',
|
dateofbirth3 = '',
|
||||||
sex3 = '',
|
sex3 = '',
|
||||||
height3 = ''
|
height3 = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(data)
|
callback(data)
|
||||||
else
|
end
|
||||||
local data = {
|
end)
|
||||||
identifier = '',
|
|
||||||
firstname1 = '',
|
|
||||||
lastname1 = '',
|
|
||||||
dateofbirth1 = '',
|
|
||||||
sex1 = '',
|
|
||||||
height1 = '',
|
|
||||||
firstname2 = '',
|
|
||||||
lastname2 = '',
|
|
||||||
dateofbirth2 = '',
|
|
||||||
sex2 = '',
|
|
||||||
height2 = '',
|
|
||||||
firstname3 = '',
|
|
||||||
lastname3 = '',
|
|
||||||
dateofbirth3 = '',
|
|
||||||
sex3 = '',
|
|
||||||
height3 = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
callback(data)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function setIdentity(identifier, data, callback)
|
function setIdentity(identifier, data, callback)
|
||||||
MySQL.Async.execute("UPDATE `users` SET `firstname` = @firstname, `lastname` = @lastname, `dateofbirth` = @dateofbirth, `sex` = @sex, `height` = @height WHERE identifier = @identifier",
|
MySQL.Async.execute("UPDATE `users` SET `firstname` = @firstname, `lastname` = @lastname, `dateofbirth` = @dateofbirth, `sex` = @sex, `height` = @height WHERE identifier = @identifier",
|
||||||
{
|
{
|
||||||
['@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
|
||||||
},
|
}, function(done)
|
||||||
function(done)
|
if callback then
|
||||||
if callback then
|
callback(true)
|
||||||
callback(true)
|
end
|
||||||
end
|
end)
|
||||||
end)
|
|
||||||
|
|
||||||
MySQL.Async.execute(
|
MySQL.Async.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
|
||||||
|
|
||||||
function updateIdentity(identifier, data, callback)
|
function updateIdentity(identifier, data, callback)
|
||||||
MySQL.Async.execute("UPDATE `users` SET `firstname` = @firstname, `lastname` = @lastname, `dateofbirth` = @dateofbirth, `sex` = @sex, `height` = @height WHERE identifier = @identifier",
|
MySQL.Async.execute("UPDATE `users` SET `firstname` = @firstname, `lastname` = @lastname, `dateofbirth` = @dateofbirth, `sex` = @sex, `height` = @height WHERE identifier = @identifier",
|
||||||
{
|
{
|
||||||
['@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
|
||||||
},
|
}, function(done)
|
||||||
function(done)
|
if callback then
|
||||||
if callback then
|
callback(true)
|
||||||
callback(true)
|
end
|
||||||
end
|
end)
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function deleteIdentity(identifier, data, callback)
|
function deleteIdentity(identifier, data, callback)
|
||||||
MySQL.Async.execute("DELETE FROM `characters` WHERE identifier = @identifier AND firstname = @firstname AND lastname = @lastname AND dateofbirth = @dateofbirth AND sex = @sex AND height = @height",
|
MySQL.Async.execute("DELETE FROM `characters` WHERE identifier = @identifier AND firstname = @firstname AND lastname = @lastname AND dateofbirth = @dateofbirth AND sex = @sex AND height = @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
|
||||||
},
|
}, function(done)
|
||||||
function(done)
|
if callback then
|
||||||
if callback then
|
callback(true)
|
||||||
callback(true)
|
end
|
||||||
end
|
end)
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterServerEvent('esx_identity:setIdentity')
|
RegisterServerEvent('esx_identity:setIdentity')
|
||||||
@@ -194,7 +189,7 @@ AddEventHandler('esx_identity:setIdentity', function(data, myIdentifiers)
|
|||||||
if callback then
|
if callback then
|
||||||
TriggerClientEvent('esx_identity:identityCheck', myIdentifiers.playerid, true)
|
TriggerClientEvent('esx_identity:identityCheck', myIdentifiers.playerid, true)
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed To Set Identity!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed to set identity, try again!!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
@@ -217,20 +212,10 @@ AddEventHandler('es:playerLoaded', function(source)
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
TriggerEvent('es:addGroupCommand', 'idhelp', "user", function(source, args, user)
|
|
||||||
TriggerClientEvent('chatMessage', source, '[IDENTITY]', {255, 0, 0}, "Commands List")
|
|
||||||
TriggerClientEvent('chatMessage', source, '[IDENTITY]', {255, 0, 0}, "/register - Register A New Character")
|
|
||||||
TriggerClientEvent('chatMessage', source, '[IDENTITY]', {255, 0, 0}, "/charlist - List Your Characters")
|
|
||||||
TriggerClientEvent('chatMessage', source, '[IDENTITY]', {255, 0, 0}, "/charselect 1,2,3 - Change Your Active Character")
|
|
||||||
TriggerClientEvent('chatMessage', source, '[IDENTITY]', {255, 0, 0}, "/delchar 1,2,3 - Delete A Character")
|
|
||||||
end, function(source, args, user)
|
|
||||||
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
|
|
||||||
end, {help = "List all the identity-related commands"})
|
|
||||||
|
|
||||||
TriggerEvent('es:addCommand', 'register', function(source, args, user)
|
TriggerEvent('es:addCommand', 'register', function(source, args, user)
|
||||||
getCharacters(source, function(data)
|
getCharacters(source, function(data)
|
||||||
if data.firstname3 ~= '' then
|
if data.firstname3 ~= '' then
|
||||||
TriggerClientEvent('chatMessage', source, '[IDENTITY]', {255, 0, 0}, "You Can Only Have 3 Characters.")
|
TriggerClientEvent('chatMessage', source, '[IDENTITY]', {255, 0, 0}, "You can only have 3 registered characters. Use the ^3/delchar^0 command in order to delete existing characters.")
|
||||||
else
|
else
|
||||||
TriggerClientEvent('esx_identity:showRegisterIdentity', source, {})
|
TriggerClientEvent('esx_identity:showRegisterIdentity', source, {})
|
||||||
end
|
end
|
||||||
@@ -240,14 +225,14 @@ end, {help = "Register a new character"})
|
|||||||
TriggerEvent('es:addGroupCommand', 'char', "user", function(source, args, user)
|
TriggerEvent('es:addGroupCommand', 'char', "user", function(source, args, user)
|
||||||
getIdentity(source, function(data)
|
getIdentity(source, function(data)
|
||||||
if data.firstname == '' then
|
if data.firstname == '' then
|
||||||
TriggerClientEvent('chatMessage', source, '[IDENTITY]', {255, 0, 0}, "You Have No Active Character.")
|
TriggerClientEvent('chatMessage', source, '[IDENTITY]', {255, 0, 0}, "You do not have an active character!")
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, '[IDENTITY] Active Character:', {255, 0, 0}, data.firstname .. " " .. data.lastname)
|
TriggerClientEvent('chatMessage', source, '[IDENTITY] Active Character:', {255, 0, 0}, data.firstname .. " " .. data.lastname)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end, function(source, args, user)
|
end, function(source, args, user)
|
||||||
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient permissions!")
|
||||||
end, {help = "List Your Current Active Character"})
|
end, {help = "List your current character"})
|
||||||
|
|
||||||
TriggerEvent('es:addGroupCommand', 'charlist', "user", function(source, args, user)
|
TriggerEvent('es:addGroupCommand', 'charlist', "user", function(source, args, user)
|
||||||
getCharacters(source, function(data)
|
getCharacters(source, function(data)
|
||||||
@@ -262,12 +247,12 @@ TriggerEvent('es:addGroupCommand', 'charlist', "user", function(source, args, us
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, '[IDENTITY]', {255, 0, 0}, "You Have No Characters. Please use the /register command.")
|
TriggerClientEvent('chatMessage', source, '[IDENTITY]', {255, 0, 0}, "You have no registered characters. Use the ^3/register^0 command to register an character.")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end, function(source, args, user)
|
end, function(source, args, user)
|
||||||
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient permissions!")
|
||||||
end, {help = "List Your Characters"})
|
end, {help = "List all your registered characters"})
|
||||||
|
|
||||||
TriggerEvent('es:addGroupCommand', 'charselect', "user", function(source, args, user)
|
TriggerEvent('es:addGroupCommand', 'charselect', "user", function(source, args, user)
|
||||||
local charNumber = tonumber(args[1])
|
local charNumber = tonumber(args[1])
|
||||||
@@ -275,12 +260,12 @@ TriggerEvent('es:addGroupCommand', 'charselect', "user", function(source, args,
|
|||||||
getCharacters(source, function(data)
|
getCharacters(source, function(data)
|
||||||
if charNumber == 1 then
|
if charNumber == 1 then
|
||||||
local data = {
|
local data = {
|
||||||
identifier = data.identifier,
|
identifier = data.identifier,
|
||||||
firstname = data.firstname1,
|
firstname = data.firstname1,
|
||||||
lastname = data.lastname1,
|
lastname = data.lastname1,
|
||||||
dateofbirth = data.dateofbirth1,
|
dateofbirth = data.dateofbirth1,
|
||||||
sex = data.sex1,
|
sex = data.sex1,
|
||||||
height = data.height1
|
height = data.height1
|
||||||
}
|
}
|
||||||
|
|
||||||
if data.firstname ~= '' then
|
if data.firstname ~= '' then
|
||||||
@@ -288,7 +273,7 @@ TriggerEvent('es:addGroupCommand', 'charselect', "user", function(source, args,
|
|||||||
if callback then
|
if callback then
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Updated your active character to " .. data.firstname .. " " .. data.lastname .. "!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Updated your active character to " .. data.firstname .. " " .. data.lastname .. "!")
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed To Update Identity!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed to update your identity, try again!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
@@ -297,12 +282,12 @@ TriggerEvent('es:addGroupCommand', 'charselect', "user", function(source, args,
|
|||||||
elseif charNumber == 2 then
|
elseif charNumber == 2 then
|
||||||
|
|
||||||
local data = {
|
local data = {
|
||||||
identifier = data.identifier,
|
identifier = data.identifier,
|
||||||
firstname = data.firstname2,
|
firstname = data.firstname2,
|
||||||
lastname = data.lastname2,
|
lastname = data.lastname2,
|
||||||
dateofbirth = data.dateofbirth2,
|
dateofbirth = data.dateofbirth2,
|
||||||
sex = data.sex2,
|
sex = data.sex2,
|
||||||
height = data.height2
|
height = data.height2
|
||||||
}
|
}
|
||||||
|
|
||||||
if data.firstname ~= '' then
|
if data.firstname ~= '' then
|
||||||
@@ -311,7 +296,7 @@ TriggerEvent('es:addGroupCommand', 'charselect', "user", function(source, args,
|
|||||||
if callback then
|
if callback then
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Updated your active character to " .. data.firstname .. " " .. data.lastname .. "!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Updated your active character to " .. data.firstname .. " " .. data.lastname .. "!")
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed To Update Identity!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed to update your identity, try again!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
@@ -320,12 +305,12 @@ TriggerEvent('es:addGroupCommand', 'charselect', "user", function(source, args,
|
|||||||
elseif charNumber == 3 then
|
elseif charNumber == 3 then
|
||||||
|
|
||||||
local data = {
|
local data = {
|
||||||
identifier = data.identifier,
|
identifier = data.identifier,
|
||||||
firstname = data.firstname3,
|
firstname = data.firstname3,
|
||||||
lastname = data.lastname3,
|
lastname = data.lastname3,
|
||||||
dateofbirth = data.dateofbirth3,
|
dateofbirth = data.dateofbirth3,
|
||||||
sex = data.sex3,
|
sex = data.sex3,
|
||||||
height = data.height3
|
height = data.height3
|
||||||
}
|
}
|
||||||
|
|
||||||
if data.firstname ~= '' then
|
if data.firstname ~= '' then
|
||||||
@@ -333,20 +318,20 @@ TriggerEvent('es:addGroupCommand', 'charselect', "user", function(source, args,
|
|||||||
if callback then
|
if callback then
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Updated your active character to " .. data.firstname .. " " .. data.lastname .. "!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Updated your active character to " .. data.firstname .. " " .. data.lastname .. "!")
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed To Update Identity!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed to update your identity, try again!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "You don\'t have a character in slot 3!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "You don\'t have a character in slot 3!")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed To Update Identity!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed to update your identity, try again!")
|
||||||
end
|
end
|
||||||
|
|
||||||
end)
|
end)
|
||||||
end, function(source, args, user)
|
end, function(source, args, user)
|
||||||
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient permissions!")
|
||||||
end, {help = "/charselect 1,2,3"})
|
end, {help = "Switch character", params = {{name = "char", help = "character id, ranges from 1-3"}}})
|
||||||
|
|
||||||
TriggerEvent('es:addGroupCommand', 'delchar', "user", function(source, args, user)
|
TriggerEvent('es:addGroupCommand', 'delchar', "user", function(source, args, user)
|
||||||
|
|
||||||
@@ -357,20 +342,20 @@ TriggerEvent('es:addGroupCommand', 'delchar', "user", function(source, args, use
|
|||||||
if charNumber == 1 then
|
if charNumber == 1 then
|
||||||
|
|
||||||
local data = {
|
local data = {
|
||||||
identifier = data.identifier,
|
identifier = data.identifier,
|
||||||
firstname = data.firstname1,
|
firstname = data.firstname1,
|
||||||
lastname = data.lastname1,
|
lastname = data.lastname1,
|
||||||
dateofbirth = data.dateofbirth1,
|
dateofbirth = data.dateofbirth1,
|
||||||
sex = data.sex1,
|
sex = data.sex1,
|
||||||
height = data.height1
|
height = data.height1
|
||||||
}
|
}
|
||||||
|
|
||||||
if data.firstname ~= '' then
|
if data.firstname ~= '' then
|
||||||
deleteIdentity(GetPlayerIdentifiers(source)[1], data, function(callback)
|
deleteIdentity(GetPlayerIdentifiers(source)[1], data, function(callback)
|
||||||
if callback then
|
if callback then
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "You Have Deleted " .. data.firstname .. " " .. data.lastname .. "!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "You have deleted ^3" .. data.firstname .. " " .. data.lastname .. "!")
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed To Delete Identity!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed to delete the identity, try again!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
@@ -380,20 +365,20 @@ TriggerEvent('es:addGroupCommand', 'delchar', "user", function(source, args, use
|
|||||||
elseif charNumber == 2 then
|
elseif charNumber == 2 then
|
||||||
|
|
||||||
local data = {
|
local data = {
|
||||||
identifier = data.identifier,
|
identifier = data.identifier,
|
||||||
firstname = data.firstname2,
|
firstname = data.firstname2,
|
||||||
lastname = data.lastname2,
|
lastname = data.lastname2,
|
||||||
dateofbirth = data.dateofbirth2,
|
dateofbirth = data.dateofbirth2,
|
||||||
sex = data.sex2,
|
sex = data.sex2,
|
||||||
height = data.height2
|
height = data.height2
|
||||||
}
|
}
|
||||||
|
|
||||||
if data.firstname ~= '' then
|
if data.firstname ~= '' then
|
||||||
deleteIdentity(GetPlayerIdentifiers(source)[1], data, function(callback)
|
deleteIdentity(GetPlayerIdentifiers(source)[1], data, function(callback)
|
||||||
if callback then
|
if callback then
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "You Have Deleted " .. data.firstname .. " " .. data.lastname .. "!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "You have deleted ^3" .. data.firstname .. " " .. data.lastname .. "!")
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed To Delete Identity!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed to delete the identity, try again!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
@@ -403,30 +388,29 @@ TriggerEvent('es:addGroupCommand', 'delchar', "user", function(source, args, use
|
|||||||
elseif charNumber == 3 then
|
elseif charNumber == 3 then
|
||||||
|
|
||||||
local data = {
|
local data = {
|
||||||
identifier = data.identifier,
|
identifier = data.identifier,
|
||||||
firstname = data.firstname3,
|
firstname = data.firstname3,
|
||||||
lastname = data.lastname3,
|
lastname = data.lastname3,
|
||||||
dateofbirth = data.dateofbirth3,
|
dateofbirth = data.dateofbirth3,
|
||||||
sex = data.sex3,
|
sex = data.sex3,
|
||||||
height = data.height3
|
height = data.height3
|
||||||
}
|
}
|
||||||
|
|
||||||
if data.firstname ~= '' then
|
if data.firstname ~= '' then
|
||||||
|
|
||||||
deleteIdentity(GetPlayerIdentifiers(source)[1], data, function(callback)
|
deleteIdentity(GetPlayerIdentifiers(source)[1], data, function(callback)
|
||||||
if callback then
|
if callback then
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "You Have Deleted " .. data.firstname .. " " .. data.lastname .. "!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "You have deleted ^3" .. data.firstname .. " " .. data.lastname .. "!")
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed To Delete Identity!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed to delete the identity, try again!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "You don\'t have a character in slot 3!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "You don\'t have a character in slot 3!")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed To Delete Identity!")
|
TriggerClientEvent('chatMessage', source, "[IDENTITY]", {255, 0, 0}, "Failed to delete the identity, try again!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end, function(source, args, user)
|
end, function(source, args, user)
|
||||||
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient permissions!")
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient permissions!")
|
||||||
end, {help = "/delchar 1,2,3"})
|
end, {help = "Delete an character", params = {{name = "char", help = "character id, ranges from 1-3"}}})
|
||||||
|
|||||||
Reference in New Issue
Block a user