Rafikus Posted November 27, 2018 Share 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 Link to comment Share on other sites More sharing options...
Xabi Posted November 27, 2018 Share 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 Link to comment Share on other sites More sharing options...
Rafikus Posted November 27, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
Xabi Posted November 27, 2018 Share 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 Link to comment Share on other sites More sharing options...
Rafikus Posted November 27, 2018 Author Share 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? Link to comment Share on other sites More sharing options...
Xabi Posted November 27, 2018 Share 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 Link to comment Share on other sites More sharing options...
enisn Posted December 9, 2018 Share 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) ========================================================= Link to comment Share on other sites More sharing options...
trolovecro Posted December 10, 2018 Share Posted December 10, 2018 Thanks @Xabi also didnt work for me,but now its working. Thanks a lot! Link to comment Share on other sites More sharing options...
Jappa Posted December 24, 2018 Share Posted December 24, 2018 Thanks! Works perfectly for me Link to comment Share on other sites More sharing options...
St3fan[NL] Posted April 11, 2019 Share Posted April 11, 2019 I have followed this, even done a successful rebuild of the solution, but events still wont be triggered. @Xabi any thoughts? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now