SampSharp icon indicating copy to clipboard operation
SampSharp copied to clipboard

[GM] Fixed wrong BasePlayer returned on NPC connection

Open LDami opened this issue 3 years ago • 0 comments

Actually the ConnectNPC method returns a empty BasePlayer instance. The problem is we can't know when the NPC will be connected to the server ..

So I've created a "NPC" class with a Thread in it to loop through all connected players and check if a player matches with the NPC. When a player matches with the NPC (same name, and "IsNPC" is true), an event is triggered to be able to make some actions after the NPC connection.

LDami avatar Mar 06 '21 02:03 LDami