Facepunch / garrysmod-issues

Garry's Mod issue tracker
141 stars 56 forks source link

PlayerConnect not triggered clientside #3416

Open EstevanTH opened 6 years ago

EstevanTH commented 6 years ago

Details

The PlayerConnect event is never triggered clientside.

Steps to reproduce

On server

sv_allowcslua 1

Then on client

lua_run_cl hook.Add('PlayerConnect','debug_hook',function(...)print('PlayerConnect:',...)end)

Invite another player, nothing shows in client console.

Thanks

Momo :heart:

Kefta commented 6 years ago

I think it's only meant to be called serverside; try using the player_connect gameevent clientside, instead.

EstevanTH commented 6 years ago

I think exactly the same.

My question is: should I fix what the realm on the wiki? I think it may be a bug because the bot detected the hook as shared, so it is probably declared clientside for some reason.

Kefta commented 6 years ago

So this actually is called clientside. Seems to be called fine for bots:

CornerPin commented 6 years ago

Only works on clientside if you are a host.