Mondi_DE Posted December 28, 2018 Posted December 28, 2018 hey guys, I need some help because my Server doesn't call the playerConnected Event using GTANetworkAPI; using System; using System.Threading.Tasks; class Player : Script { [ServerEvent(Event.PlayerConnected)] public void OnPlayerConnected(Client player) { Task.Factory.StartNew(() => { NAPI.Task.Run(() => { player.SetSharedData(EntityData.PLAYER_MONEY, 100); int playerMoney = player.GetSharedData(EntityData.PLAYER_MONEY); NAPI.Util.ConsoleOutput("bankkontostand: " + player.GetSharedData(EntityData.PLAYER_BANK)); NAPI.Util.ConsoleOutput("Bargeld: " + player.GetSharedData(EntityData.PLAYER_MONEY)); player.SendNotification("Willkommen zurück"); }); }); } } I've tried it with and without the tasks and with one and only called method s.th. like player.sendMessage("hello"); at the playerConnect event too, but the server also didn't call it
Xabi Posted December 29, 2018 Posted December 29, 2018 You need to use the Bootstrapper.dll on runtime folder, not the one from the Nuget package.
Mondi_DE Posted December 30, 2018 Author Posted December 30, 2018 (edited) vor 20 Stunden schrieb Xabi: You need to use the Bootstrapper.dll on runtime folder, not the one from the Nuget package. which version should it be? i'v copied the bootstrapper.dll from an older version of the server (Bootstrapper.dll version: 0.3.6.0 and this doesn't work too, after client restart the bootstrapper.dll was updated to version 0.3.7.0 EDIT: How can I check from where VS loads the Bootstrapper.dll ? Is there a possibility? Edited December 30, 2018 by Mondi_DE
Xabi Posted December 30, 2018 Posted December 30, 2018 (edited) 4 hours ago, Mondi_DE said: which version should it be? i'v copied the bootstrapper.dll from an older version of the server (Bootstrapper.dll version: 0.3.6.0 and this doesn't work too, after client restart the bootstrapper.dll was updated to version 0.3.7.0 EDIT: How can I check from where VS loads the Bootstrapper.dll ? Is there a possibility? 0.3.7 if you want the latest. Edited December 30, 2018 by Xabi
.Neø Posted December 30, 2018 Posted December 30, 2018 Finnaly here a LIVE Previo what is real Wrong @Xabi https://twitch.tv/theneotv
Mondi_DE Posted December 30, 2018 Author Posted December 30, 2018 (edited) vor 5 Stunden schrieb Xabi: 0.3.7 if you want the latest. yeah, that's exactly the version I have. copy it from the 'runtime' folder and paste it to the 'networkapp2.2' folder. after rebuild it was also in my project folder. I've setup my IDE like in THIS tutorial, maybe it's outdated and no more comaptible with the current version of rage mp? or maybe i need some more *.ddl files: i always get an error in te 'server_exceptions.txt' file System.IO.FileNotFoundException: Could not load the specified file. File name: 'System.Runtime' at Assembly System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) Edited December 30, 2018 by Mondi_DE
Xabi Posted December 30, 2018 Posted December 30, 2018 Seems you're compiling it with the Nuget's library. Just remove the Nuget and add the Bootstrapper.dll from runtime to the solution on Visual Studio as a dependency. 1
Mondi_DE Posted December 30, 2018 Author Posted December 30, 2018 vor 11 Minuten schrieb Xabi: Seems you're compiling it with the Nuget's library. Just remove the Nuget and add the Bootstrapper.dll from runtime to the solution on Visual Studio as a dependency. yeeees, i had installed the gtanetwork.api. now i 've uninstall it and it works 👍 💪
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