Posts: 319
Threads: 4
Joined: Jul 2007
Reputation:
0
I don't know which JPA you are using. Shoebill does not affect the behavior of JPA's, you may just have to look into the documentation of the JPA you are using right now. Maybe you can show us your folder structure, the code & error, maybe we can help you.
Posts: 6
Threads: 0
Joined: Nov 2015
Reputation:
0
I attached my project (NetBeans). The class serverSAMPerrr contains a method onEnable. At the start of the method code which is identical to the code in the class NewClass.java. When I run the class NewClass.java there are no errors. But when I run the server with my game mode I get an exception:
javax.persistence.PersistenceException: No Persistence provider for EntityManager named ServerSAMPPU.
I think i get this exception because java does not see my persistence.xml. So I thought that the file persistece.xml need to put in a special server folder.
I use eclipce persistance API.
Sorry for my English.
Posts: 319
Threads: 4
Joined: Jul 2007
Reputation:
0
I you don't use Maven, you will have to add your runtime libraries to the resources.yml's "runtimes" section.
You will need a .jar file that provides the driver for your JPA. Put it in the shoebill/libraries folder and add the file to your resources.yml in the "runtimes" section (don't add the .jar at the filename in the resources.yml)
Posts: 6
Threads: 0
Joined: Nov 2015
Reputation:
0
Hi, help me please!
getEventManager().registerHandler(MenuSelectedEven t.class, (e)->{
if(e.getMenu()==null)
System.out.println("WTF");
});
why in this code e.getMenu() return null?
Posts: 319
Threads: 4
Joined: Jul 2007
Reputation:
0
@dusk:
Q1: The callback will call when the interval has elapsed. It will call as many times as the timer runs. If you use 2 repeats (like in the example) the callback will be called twice. The first one will be called after 1 second and the second one will be called after 2 seconds. After that, the timer will be destroyed, no need for manually calling .destroy(). Please keep in mind, that Java uses Garbage Collection and if you lose the reference to the timer object, it might be destroyed too early. You will want to keep a reference to it somehow, like creating a global variable and assigning the timer to it.
Q2: There is a explosion for only a specific player and also a explosion for the world. If you look into the api documentation you can see, that the World class also contains a method called createExplosion. If you use this method, the explosion will be seen by everybody, if you use the Player's createExplosion, only the player will see it.
@OspIrAnt: It might be a bug. I will take a look at it at the weekend.
Posts: 319
Threads: 4
Joined: Jul 2007
Reputation:
0
Shoebill will automatically remove all timers if you do not assign a variable to it. This will prevent that unwanted timers will keep running in the background forever (look at the code @ getTimers()).
Posts: 319
Threads: 4
Joined: Jul 2007
Reputation:
0
@dusk: You will need to call the Pawn method in your pawn code. If the debug message from pawn is not called, there might be a problem in your pawn code.
Posts: 1,113
Threads: 127
Joined: Jul 2008
Reputation:
0
That's the weird part. Pawn debug message is printed once, but the one in Java is printed twice.
Posts: 319
Threads: 4
Joined: Jul 2007
Reputation:
0
@dusk: I will take a look at it at the weekend. Which Shoebill version are you using? 1.2 (beta) or 1.1 ?
Posts: 319
Threads: 4
Joined: Jul 2007
Reputation:
0
@valych: Nice to hear. You can create a global field to access an EventManager in your game mode, but keep in mind, that you should use the correct EventManager for each plugin and game mode. Don't share EventManagers between (Shoebill) Plugins and (Shoebill) Gamemodes.
I will take a look at your problem with the CreationFailedException and report back when I found / fixed something.
//Edit: Can you show many any code related to this issue? And are you using Shoebill 1.2?
Posts: 319
Threads: 4
Joined: Jul 2007
Reputation:
0
@dusk: I think you generate your project files with a never version of Visual Studio than you are using when opening them.
I see the problem with the GetVehicleParamsEx function. Unfortunately the function made by sampgdk accepts booleans. I made a workaround for it, but I maybe create an issue on sampgdk's Github page.
Posts: 1,113
Threads: 127
Joined: Jul 2008
Reputation:
0
That's the interesting thing. I generate it for "Visual studio 14 2015" and I AM using "Visual studio 14 2015". So I really don't understand why does it say it isn't the right version...
Posts: 110
Threads: 3
Joined: Aug 2009
Reputation:
0
@mk124, I dont think that examples are necessary, because there are just a lot of objects that are simply created by CreateDynamicObject function in pawn.
Also, if it is necessary I can use your lvdm game mode with a bare pawn game mode to check if there is the same problem with this exception.