Quote:
Originally Posted by gyula359
who can help me set up ammo?
I make a server, but the ammo doesn't run out, it's endless, even though I have an ammo system
Help?
Discord:traviancx#9756
|
I'm not going to make the code for you, and I don't remember what packages you are going to use to communicate with the client but then what do you have to do:
1: Create a table in the database for them.
2: Add a table request to the emulator whenever a player connects.
3: If you use an external store system, I suggest adding ammunition via the emulator and DO NOT CONNECT DIRECTLY to the database, so the emulator does not need to update the database whenever the player expends ammo to maintain consistency and this will avoid overloading the database.
4: The ammunition spending system does as you see fit, but remember to update the database periodically, when the player jumps into a portal, when it disconnects, dies, etc.
5: As for the visual part, you can:
5.1 Send a package whenever the player spends ammunition, maintaining a precise value but using a lot of bandwidth.
5.2 Periodically send a value to avoid errors, and let the client itself deal with the visual values, for example: (Send the amount of ammunition and lasers equipped in the configuration and then let the client subtract each shot of a certain ammunition type) this will greatly reduce bandwidth usage.
As for it being endless, how about checking the amount of ammunition before each shot?
I think that's it, as for packages you will have to look for them yourself.