Qbox-project / qbx_core

http://qbox-project.github.io
Other
46 stars 113 forks source link

add server side playerLoggedOut Event Handler #503

Closed ARSSANTO closed 1 week ago

ARSSANTO commented 1 week ago

Description

This event will work as handler like

-- Add any additional event handlers for player logout
-- Server Side
AddEventHandler('qbx_core:server:playerLoggedOut', function(source)
    -- Add any additional actions you want to perform when a player logs out
    print('Player with source ID ' .. source .. ' has logged out.')
end)

Checklist

ARSSANTO commented 1 week ago

What's the use case for this? Do you have a specific need in mind?

Yes I have and already using it so on the server side there if this event triggers I can send logs then also I can delete props from logged out player very easily and many more server side action can be taken directly while player logged out .

rather going to client side and back to server side

AddEventHandler('qbx_core:server:playerLoggedOut', function(source)
    -- Add any additional actions you want to perform when a player logs out
    print('Player with source ID ' .. source .. ' has logged out.')
end)
FjamZoo commented 1 week ago

What's the use case for this? Do you have a specific need in mind?

Its a good addition makes it so we dont need to use the standard "onPlayerDrop" event while also supporting logging out of multi characters.