Learn about and how to use common core client events!
RegisterNetEvent('RSGCore:Client:OnPlayerLoaded', function() print('Im a client and i just loaded into your server!') end)
RegisterNetEvent('RSGCore:Client:OnPlayerUnload', function() print('Im a client and i just logged out of your server!') end)
RegisterNetEvent('RSGCore:Client:PvpHasToggled', function(pvp_state) print('PVP mode has been set to '..pvp_state..'!') end)
-- /spawnveh cart RegisterCommand('spawnveh', function(_, args) local vehicle = RSGCore.Shared.Trim(args[1]) TriggerEvent('RSGCore:Command:SpawnVehicle', vehicle) end)
-- /spawnveh wagon RegisterCommand('spawnveh', function(source, args) local vehicle = RSGCore.Shared.Trim(args[1]) TriggerClientEvent('RSGCore:Command:SpawnVehicle', source, vehicle) end)
RegisterCommand('deleteveh', function(_, args) TriggerEvent('RSGCore:Command:DeleteVehicle') end)
RegisterCommand('deleteveh', function(source, args) TriggerClientEvent('RSGCore:Command:DeleteVehicle', source) end)
RegisterNetEvent('RSGCore:Player:SetPlayerData', function(val) PlayerData = val print(RSGCore.Debug(PlayerData)) end)
-- /useitem bread 1 RegisterCommand('useitem', function(_, args) local item = { name = args[1], amount = tonumber(args[2]) } TriggerEvent('RSGCore:Client:UseItem', item) end)
-- /useitem bread 1 RegisterCommand('useitem', function(source, args) local item = { name = args[1], amount = tonumber(args[2]) } TriggerClientEvent('RSGCore:Client:UseItem', source, item) end)
RegisterNetEvent('RGCore:Client:UpdateObject', function() RSGCore = exports['rsg-core']:GetCoreObject() end)