Events
Lokale Events, mit AddEventHandler.
Client
cs_shops:opened
ClientAddEventHandler('cs_shops:opened', function(shopId) end) cs_shops:closed
ClientAddEventHandler('cs_shops:closed', function(shopId) end) cs_shops:purchase
ClientAddEventHandler('cs_shops:purchase', function(shopId, total, partial) end) partial ist true, wenn ein Teil nicht passte und erstattet wurde.
Server
cs_shops:opened
ServerAddEventHandler('cs_shops:opened', function(source, shopId) end) cs_shops:closed
ServerAddEventHandler('cs_shops:closed', function(source, shopId) end) cs_shops:purchase
ServerAddEventHandler('cs_shops:purchase', function(source, data) end) datatable{ shop, label, items = { { name, label, count, price } }, total, refunded, account, balance }
Beispiel
AddEventHandler('cs_shops:purchase', function(src, data)
TriggerEvent('bank:addSociety', 'shops', data.total)
end)cs_shops:license
ServerAddEventHandler('cs_shops:license', function(source, data) end) datatable{ shop, label, license, price }
purchase und license kommen, nachdem der Spieler bedient ist. Was du darin tust, kann einen Kauf weder aufhalten noch zurücknehmen. Zum Verhindern ist canBuy da, zum Mitschreiben diese Events.