From 5df65428717e379950eb2360443ec12d5cdf7b4f Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 3 Nov 2018 23:10:19 +0100 Subject: [PATCH] Renamed column isDead to is_dead --- client/main.lua | 2 +- esx_ambulancejob.sql | 4 +++- localization/de_esx_ambulancejob.sql | 4 +++- localization/en_esx_ambulancejob.sql | 4 +++- localization/fi_esx_ambulancejob.sql | 4 +++- localization/pl_esx_ambulancejob.sql | 4 +++- server/main.lua | 7 +++---- 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/client/main.lua b/client/main.lua index b3fe27ee..0e739c98 100644 --- a/client/main.lua +++ b/client/main.lua @@ -296,7 +296,7 @@ AddEventHandler('esx_ambulancejob:revive', function() DoScreenFadeOut(800) while not IsScreenFadedOut() do - Citizen.Wait(0) + Citizen.Wait(50) end ESX.SetPlayerData('lastPosition', { diff --git a/esx_ambulancejob.sql b/esx_ambulancejob.sql index ddb05e02..d88d5676 100644 --- a/esx_ambulancejob.sql +++ b/esx_ambulancejob.sql @@ -28,4 +28,6 @@ INSERT INTO `items` (name, label, `limit`) VALUES ('medikit','Medikit', 5) ; -ALTER TABLE `users` ADD `isDead` BIT(1) DEFAULT b'0' +ALTER TABLE `users` + ADD `is_dead` TINYINT(1) NULL DEFAULT '0' +; diff --git a/localization/de_esx_ambulancejob.sql b/localization/de_esx_ambulancejob.sql index d11f2575..0ebf079d 100644 --- a/localization/de_esx_ambulancejob.sql +++ b/localization/de_esx_ambulancejob.sql @@ -28,4 +28,6 @@ INSERT INTO `items` (name, label, `limit`) VALUES ('medikit','Medikit', 5) ; -ALTER TABLE `users` ADD `isDead` BIT(1) DEFAULT b'0' +ALTER TABLE `users` + ADD `is_dead` TINYINT(1) NULL DEFAULT '0' +; diff --git a/localization/en_esx_ambulancejob.sql b/localization/en_esx_ambulancejob.sql index cbe37090..6bb4ecf1 100644 --- a/localization/en_esx_ambulancejob.sql +++ b/localization/en_esx_ambulancejob.sql @@ -28,4 +28,6 @@ INSERT INTO `items` (name, label, `limit`) VALUES ('medikit','Medikit', 5) ; -ALTER TABLE `users` ADD `isDead` BIT(1) DEFAULT b'0' +ALTER TABLE `users` + ADD `is_dead` TINYINT(1) NULL DEFAULT '0' +; diff --git a/localization/fi_esx_ambulancejob.sql b/localization/fi_esx_ambulancejob.sql index 3ea64c07..7c001e0d 100644 --- a/localization/fi_esx_ambulancejob.sql +++ b/localization/fi_esx_ambulancejob.sql @@ -28,4 +28,6 @@ INSERT INTO `items` (name, label, `limit`) VALUES ('medikit','Ensiapupakkaus', 5) ; -ALTER TABLE `users` ADD `isDead` BIT(1) DEFAULT b'0' +ALTER TABLE `users` + ADD `is_dead` TINYINT(1) NULL DEFAULT '0' +; diff --git a/localization/pl_esx_ambulancejob.sql b/localization/pl_esx_ambulancejob.sql index a9035d79..c3715181 100644 --- a/localization/pl_esx_ambulancejob.sql +++ b/localization/pl_esx_ambulancejob.sql @@ -28,4 +28,6 @@ INSERT INTO `items` (name, label, `limit`) VALUES ('medikit','Defibrylator', 5) ; -ALTER TABLE `users` ADD `isDead` BIT(1) DEFAULT b'0' +ALTER TABLE `users` + ADD `is_dead` TINYINT(1) NULL DEFAULT '0' +; diff --git a/server/main.lua b/server/main.lua index 4eb51635..b233f93d 100644 --- a/server/main.lua +++ b/server/main.lua @@ -183,10 +183,10 @@ RegisterServerEvent('esx_ambulancejob:firstSpawn') AddEventHandler('esx_ambulancejob:firstSpawn', function() local _source = source local identifier = GetPlayerIdentifiers(_source)[1] - MySQL.Async.fetchScalar('SELECT isDead FROM users WHERE identifier = @identifier', { + MySQL.Async.fetchScalar('SELECT is_dead FROM users WHERE identifier = @identifier', { ['@identifier'] = identifier }, function(isDead) - if isDead == 1 then + if isDead then print(('esx_ambulancejob: %s attempted combat logging!'):format(identifier)) TriggerClientEvent('esx_ambulancejob:requestDeath', _source) end @@ -197,8 +197,7 @@ RegisterServerEvent('esx_ambulancejob:setDeathStatus') AddEventHandler('esx_ambulancejob:setDeathStatus', function(isDead) local identifier = GetPlayerIdentifiers(source)[1] - MySQL.Sync.execute("UPDATE users SET isDead=@isDead WHERE identifier = @identifier", - { + MySQL.Sync.execute('UPDATE users SET is_dead = @isDead WHERE identifier = @identifier', { ['@identifier'] = identifier, ['@isDead'] = isDead })