-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathServer.lua
90 lines (67 loc) · 3.31 KB
/
Server.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
-------------------------
--- Declaration d'ESX ---
-------------------------
ESX = nil TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
---------------------
--- Script Serveur ---
---------------------
RegisterServerEvent('Selene_Cafe')
AddEventHandler('Selene_Cafe', function( Item, Prix, Notif3 )
local xPlayer = ESX.GetPlayerFromId(source)
Notif2 = '~y~[ - $'..Prix..' ] ~g~[ + 1 '..ESX.GetItemLabel(Item)..' ]'
if xPlayer.getMoney() >= Prix then
TriggerClientEvent('esx:showAdvancedNotification', source, '[ Machines à Café ]', Notif2, nil, 'CHAR_BIKESITE', 0)
TriggerClientEvent('Selene_Cafe:Animation', source)
xPlayer.addInventoryItem(Item, 1)
xPlayer.removeMoney(Prix)
else TriggerClientEvent('esx:showAdvancedNotification', source, '[ Machines à Café ]', Notif3, nil, 'CHAR_BIKESITE', 0)
end
end)
RegisterServerEvent('Selene_Stand')
AddEventHandler('Selene_Stand', function( Item, Prix, Notif3 )
local xPlayer = ESX.GetPlayerFromId(source)
Notif2 = '~y~[ - $'..Prix..' ] ~g~[ + 1 '..ESX.GetItemLabel(Item)..' ]'
if xPlayer.getMoney() >= Prix then
TriggerClientEvent('esx:showAdvancedNotification', source, '[ Stand de Fruit ]', Notif2, nil, 'CHAR_BIKESITE', 0)
TriggerClientEvent('Selene_Stand:Animation', source)
xPlayer.addInventoryItem(Item, 1)
xPlayer.removeMoney(Prix)
else TriggerClientEvent('esx:showAdvancedNotification', source, '[ Stand de Fruit ]', Notif3, nil, 'CHAR_BIKESITE', 0)
end
end)
RegisterServerEvent('Selene_Fontaine')
AddEventHandler('Selene_Fontaine', function( Hydratation, Prix, Notif3 )
local xPlayer = ESX.GetPlayerFromId(source)
Notif2 = '~y~[ - $'..Prix..' ]'
if xPlayer.getMoney() >= Prix then
TriggerClientEvent('esx:showAdvancedNotification', source, '[ Fontaine ]', Notif2, nil, 'CHAR_BIKESITE', 0)
TriggerClientEvent('esx_status:add', source, 'thirst', Hydratation)
TriggerClientEvent('Selene_Fontaine:Animation', source)
xPlayer.removeMoney(Prix)
else TriggerClientEvent('esx:showAdvancedNotification', source, '[ Fontaine ]', Notif3, nil, 'CHAR_BIKESITE', 0)
end
end)
RegisterServerEvent('Selene_VendingM')
AddEventHandler('Selene_VendingM', function( Item, Prix, Notif3 )
local xPlayer = ESX.GetPlayerFromId(source)
Notif2 = '~y~[ - $'..Prix..' ] ~g~[ + 1 '..ESX.GetItemLabel(Item)..' ]'
if xPlayer.getMoney() >= Prix then
TriggerClientEvent('esx:showAdvancedNotification', source, '[ Distributeur ]', Notif2, nil, 'CHAR_BIKESITE', 0)
TriggerClientEvent('Selene_VendingM:Animation', source)
xPlayer.addInventoryItem(Item, 1)
xPlayer.removeMoney(Prix)
else TriggerClientEvent('esx:showAdvancedNotification', source, '[ Distributeur ]', Notif3, nil, 'CHAR_BIKESITE', 0)
end
end)
RegisterServerEvent('Selene_FoodVan')
AddEventHandler('Selene_FoodVan', function( Item, Prix, Notif3 )
local xPlayer = ESX.GetPlayerFromId(source)
Notif2 = '~y~[ - $'..Prix..' ] ~g~[ + 1 '..ESX.GetItemLabel(Item)..' ]'
if xPlayer.getMoney() >= Prix then
TriggerClientEvent('esx:showAdvancedNotification', source, '[ Roulotte ]', Notif2, nil, 'CHAR_BIKESITE', 0)
TriggerClientEvent('Selene_FoodVan:Animation', source)
xPlayer.addInventoryItem(Item, 1)
xPlayer.removeMoney(Prix)
else TriggerClientEvent('esx:showAdvancedNotification', source, '[ Roulotte ]', Notif3, nil, 'CHAR_BIKESITE', 0)
end
end)