Rafikus 4 Posted November 27, 2018 Hey, Im new to the RAGE-MP. I started moving from GT-MP and have issue with events. PlayerConnected doesn't trigger also PlayerDisconnected tells me that i have wrong number of parameters dispite using sample code. using GTANetworkAPI; namespace RP { public class ConnectionHandler : Script { [ServerEvent(Event.PlayerConnected)] public void OnPlayerConnect(Client player) { NAPI.Util.ConsoleOutput("Connected"); World.Players.Add(player, new Player(player)); } [ServerEvent(Event.PlayerDisconnected)] public void OnPlayerDisconnect(Client player, DisconnectionType type, string reason) { if(type == DisconnectionType.Left) NAPI.Chat.SendChatMessageToAll("~b~" + player.Name + "~w~ left. " + reason); World.Players.Remove(player); } } } I downloaded GTANetworkAPI version 3.6 as NuGet Package 2 Share this post Link to post Share on other sites
Xabi 143 Posted November 27, 2018 If you're using 0.3.6 Nuget, make sure to copy the Bootstrapper from runtimes folder into the path where the Nuget package is installed. 3 Share this post Link to post Share on other sites
Rafikus 4 Posted November 27, 2018 (edited) 47 minutes ago, Xabi said: If you're using 0.3.6 Nuget, make sure to copy the Bootstrapper from runtimes folder into the path where the Nuget package is installed. By runtimes you mean RAGEMP\server-files\bridge\runtime\runtimes or RAGEMP\server-files\bridge\runtime ? The only Bootstrapper i have is located at RAGEMP\server-files\bridge\runtime, and it's weight is the same as in Nuget package. I replaced it and nothing changed. Edited November 27, 2018 by Rafikus Share this post Link to post Share on other sites
Xabi 143 Posted November 27, 2018 6 minutes ago, Rafikus said: By runtimes you mean RAGEMP\server-files\bridge\runtime\runtimes or RAGEMP\server-files\bridge\runtime ? The only Bootstrapper i have is located at RAGEMP\server-files\bridge\runtime, and it's weight is the same as in Nuget package. I replaced it and nothing changed. Yes, that's the one i mean. You replaced the one located on the Nuget package's path, right? And after doing that, did you compile your gamemode? 3 Share this post Link to post Share on other sites
Rafikus 4 Posted November 27, 2018 3 minutes ago, Xabi said: Yes, that's the one i mean. You replaced the one located on the Nuget package's path, right? And after doing that, did you compile your gamemode? I thought i did replace it. I did now. Rebuilded my gamemode and now it works. Thank you very much. Is that written somewhere in wiki? If no, how do you know that you need to do this? Share this post Link to post Share on other sites
Xabi 143 Posted November 27, 2018 4 minutes ago, Rafikus said: I thought i did replace it. I did now. Rebuilded my gamemode and now it works. Thank you very much. Is that written somewhere in wiki? If no, how do you know that you need to do this? It's the solution George gave on Discord, seems that there were some issues with 0.3.6 Nuget package. 3 Share this post Link to post Share on other sites
enisn 0 Posted December 9, 2018 On 11/28/2018 at 1:17 AM, Xabi said: If you're using 0.3.6 Nuget, make sure to copy the Bootstrapper from runtimes folder into the path where the Nuget package is installed. Same issue here. But this doesn't helped. Started to throw that exception: ==================[9.12.2018 14:38:03]================== System.Reflection.TargetParameterCountException: Parameter count mismatch. at object[] System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) ========================================================= Share this post Link to post Share on other sites
trolovecro 3 Posted December 10, 2018 Thanks @Xabi also didnt work for me,but now its working. Thanks a lot! Share this post Link to post Share on other sites
Jappa 0 Posted December 24, 2018 Thanks! Works perfectly for me Share this post Link to post Share on other sites
St3fan[NL] 0 Posted April 11 I have followed this, even done a successful rebuild of the solution, but events still wont be triggered. @Xabi any thoughts? Share this post Link to post Share on other sites