Skip to content

Commit a738268

Browse files
committed
Update v3.7.5
* Fixed Error with Hotwire Function
1 parent 500fcea commit a738268

File tree

5 files changed

+20
-21
lines changed

5 files changed

+20
-21
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.4
1+
3.7.5

client.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,22 @@ AddEventHandler('msk_enginetoggle:Engine', function()
9595
if (GetPedInVehicleSeat(veh, -1) == PlayerPedId()) then
9696
vehicles[StateIndex][2] = not GetIsVehicleEngineRunning(veh)
9797
if vehicles[StateIndex][2] then
98-
Config.Notification(nil, 'client', nil, Translation[Config.Locale]['engine_start'])
98+
Config.Notification(nil, Translation[Config.Locale]['engine_start'])
9999
else
100-
Config.Notification(nil, 'client', nil, Translation[Config.Locale]['engine_stop'])
100+
Config.Notification(nil, Translation[Config.Locale]['engine_stop'])
101101
end
102102
end
103103
elseif IsPedInAnyVehicle(PlayerPedId(), false) and (not isVehicleOrKeyOwner or not isVehicle or not isPlate) then
104-
Config.Notification(nil, 'client', nil, Translation[Config.Locale]['key_nokey'])
104+
Config.Notification(nil, Translation[Config.Locale]['key_nokey'])
105105
end
106106
else
107107
if IsPedInAnyVehicle(PlayerPedId(), false) then
108108
if (GetPedInVehicleSeat(veh, -1) == PlayerPedId()) then
109109
vehicles[StateIndex][2] = not GetIsVehicleEngineRunning(veh)
110110
if vehicles[StateIndex][2] then
111-
Config.Notification(nil, 'client', nil, Translation[Config.Locale]['engine_start'])
111+
Config.Notification(nil, Translation[Config.Locale]['engine_start'])
112112
else
113-
Config.Notification(nil, 'client', nil, Translation[Config.Locale]['engine_stop'])
113+
Config.Notification(nil, Translation[Config.Locale]['engine_stop'])
114114
end
115115
end
116116
end
@@ -132,7 +132,7 @@ if Config.OnAtEnter then
132132
if vehicle[1] == GetVehiclePedIsTryingToEnter(PlayerPedId()) and not vehicle[2] then
133133
Wait(0)
134134
vehicle[2] = true
135-
Config.Notification(nil, 'client', nil, Translation[Config.Locale]['engine_onatenter'])
135+
Config.Notification(nil, Translation[Config.Locale]['engine_onatenter'])
136136
end
137137
end
138138
end
@@ -187,12 +187,12 @@ AddEventHandler('msk_enginetoggle:hotwire', function()
187187
SetVehicleDoorsLockedForAllPlayers(vehicle, false)
188188
FreezeEntityPosition(playerPed, false)
189189
ClearPedTasksImmediately(playerPed)
190-
Config.Notification(nil, 'client', nil, Translation[Config.Locale]['vehicle_unlocked'])
190+
Config.Notification(nil, Translation[Config.Locale]['vehicle_unlocked'])
191191
else
192192
TriggerServerEvent('msk_enginetoggle:delhotwire')
193193
FreezeEntityPosition(playerPed, false)
194194
ClearPedTasksImmediately(playerPed)
195-
Config.Notification(nil, 'client', nil, Translation[Config.Locale]['hotwiring_failed'])
195+
Config.Notification(nil, Translation[Config.Locale]['hotwiring_failed'])
196196
return
197197
end
198198

@@ -219,7 +219,7 @@ AddEventHandler('msk_enginetoggle:hotwire', function()
219219
if chance <= Config.Probability.searchKey then
220220
TriggerServerEvent('msk_enginetoggle:addcarkeys', plate)
221221
else
222-
Config.Notification(nil, 'client', nil, Translation[Config.Locale]['hotwiring_notfoundkey'])
222+
Config.Notification(nil, Translation[Config.Locale]['hotwiring_notfoundkey'])
223223
end
224224
else
225225
TriggerServerEvent('msk_enginetoggle:addcarkeys', plate)

config.lua

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Config = {}
33
Config.Locale = 'de'
44
Config.VersionChecker = true
55
----------------------------------------------------------------
6-
-- If Standalone then you have to change the Notification
6+
-- If Standalone then you cant't use the Hotwire Feature and you have to replace the Notification
77
Config.Framework = 'ESX' -- 'ESX' or 'Standalone'
88
----------------------------------------------------------------
99
-- Change 'false' to 'true' to toggle the engine automatically on when entering a vehicle
@@ -31,17 +31,16 @@ Config.Whitelist = {
3131
},
3232
plates = {
3333
-- "ESX",
34-
-- "ZOOM",
34+
-- "MSK",
3535
},
3636
}
3737
----------------------------------------------------------------
3838
-- !!! This function is clientside AND serverside !!!
39-
-- Look for type == 'client' and type == 'server'
40-
Config.Notification = function(src, action, xPlayer, message) -- xPlayer = ESX.GetPlayerFromId(src)
41-
if action == 'client' then -- clientside
42-
ESX.ShowNotification(message) -- replace this with your Notify // example: exports['okokNotify']:Alert('Crafting', message, 5000, 'info')
43-
elseif action == 'server' then -- serverside
44-
xPlayer.showNotification(message) -- replace this with your Notify // example: TriggerClientEvent('okokNotify:Alert', src, 'Crafting', message, 5000, 'info')
39+
Config.Notification = function(source, message)
40+
if IsDuplicityVersion() then -- serverside
41+
TriggerClientEvent('esx:showNotification', source, message)
42+
else -- clientside
43+
ESX.ShowNotification(message)
4544
end
4645
end
4746
----------------------------------------------------------------

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ games { 'gta5' }
44
author 'Musiker15 - MSK Scripts'
55
name 'msk_enginetoggle'
66
description 'EngineToggle for Vehicles'
7-
version '3.7.4'
7+
version '3.7.5'
88

99
lua54 'yes'
1010

server.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ end
1919
RegisterNetEvent('msk_enginetoggle:addcarkeys')
2020
AddEventHandler('msk_enginetoggle:addcarkeys', function(plate)
2121
exports["VehicleKeyChain"]:AddTempKey(source, plate)
22-
Config.Notification(source, 'server', xPlayer, Translation[Config.Locale]['hotwiring_foundkey'])
22+
Config.Notification(source, Translation[Config.Locale]['hotwiring_foundkey'])
2323
end)
2424

2525
if Config.enableLockpick and Config.Framework:match('ESX') then
@@ -51,7 +51,7 @@ if Config.enableLockpick and Config.Framework:match('ESX') then
5151
if hasItem > 0 then
5252
TriggerClientEvent('msk_enginetoggle:hotwire', source)
5353
else
54-
Config.Notification(source, 'server', xPlayer, Translation[Config.Locale]['hasno_lockpick'])
54+
Config.Notification(source, Translation[Config.Locale]['hasno_lockpick'])
5555
end
5656
end)
5757
end

0 commit comments

Comments
 (0)