C# is server Event as changed?

hello ,

i try to use these events : playerConnecting and playerDropped
but they arn’t trigger when i connect or disconnect.

i didn’t found if these event have param or not.

i have no problem client side to receive event , but from server side these one don’t want to be trigger.

Not too sure but, I think these events are client-side. As in, they’re triggered on the client so, only the client can see them.

If you want the server to listen for these events you’re going to have to trigger them manually.

For example, on the client you would have

AddEventHandler ("event", function( params )
    TriggerSeverEvent("server event", params)
end)

Then, on the server you will need to register and listen for the new event

RegisterServerEvent("server event")
AddEventHandler ("server event", function( params )
    -- do something on server
end)

Note: I have no idea how this would be done on c#

the thing is i have no problem with event client/server side , i already have many who are working perfectly , what i want to do , is to catch this event : playerConnecting specialy cause they are trigger just after the Player been create on server , that why i want to catch this one .

or maybe i will simply change the fivem script lua where the connection happen , i dunno , but i still wonder why this event (said in wiki page as server event) doesn’t work .

ok i solve it , it was just a param problem, unfortunatly params are not describe in the wiki.

1 Like