I need help How to prevent player models become NPCs after they go offline?

I need help
How to prevent player models become NPCs after they go offline?

there is a player disconnect that you could hook into and either kill or remove their entity. i find it amusing to just ragdoll them and then yeet them into the sun.

I don’t quite know how to achieve

1 Like
AddEventHandler('playerDropped', function(reason)
    -- Do whatever you want to their ped.
local playerIdx = GetPlayerFromServerId(source)
local ped = GetPlayerPed(playerIdx)
RemovePedElegantly(ped)
end)]]

that should work

Sorry, I English is very bad
I am a beginner, do still need to join What code?
Server script?
Client script?

that is client code.

Is that the case?

If it is not working…

playerDropped is server side code DOCTOR Skizot.


i have problem with player disconnect.
if i set NPC to zero with SetScenarioPedDensityMultiplierThisFrame(0.0, 0.0) then
when player exit the server , his not remove from es_admin2 list and i can see his ID on top of his head.
after 3 minutes player change to npc and run away.

i need a code which prevent change player to NPC

i want player Delete and disappear when player disconnect from server.

2 Likes

Hello
I’m using linux for FiveM server.
Just update your server version to 2380 or higher.

Hello man
I was very confused by what you said.
I have no problem with version 2380 Linux.
I really don’t know why you have this problem !!!

If you are using the Windows version of FiveM, I can’t help you because my server is Linux.

1 Like

I found out later
One of the functions of onesync

I’m not sure, but the result of my test is this

how do you do? i can`t put it off