Events

Lokale Events, mit AddEventHandler.

Client

cs_shops:opened

Client
AddEventHandler('cs_shops:opened', function(shopId) end)

cs_shops:closed

Client
AddEventHandler('cs_shops:closed', function(shopId) end)

cs_shops:purchase

Client
AddEventHandler('cs_shops:purchase', function(shopId, total, partial) end)

partial ist true, wenn ein Teil nicht passte und erstattet wurde.

Server

cs_shops:opened

Server
AddEventHandler('cs_shops:opened', function(source, shopId) end)

cs_shops:closed

Server
AddEventHandler('cs_shops:closed', function(source, shopId) end)

cs_shops:purchase

Server
AddEventHandler('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

Server
AddEventHandler('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.

Frage offen geblieben?

Schreib uns im Discord. Mit Konsolen-Auszug, Framework und Script-Version ist die erste Antwort meistens schon die Lösung.

Zum Support