24.01.2016, 11:27
(
Последний раз редактировалось Alf21; 27.01.2016 в 13:56.
)
weapon-system v4.0
Here an example weapon-system based on Shoebill (JAVA).(Original Post: https://breadfish.de/index.php?threa...postID=2074778 [GERMAN])
Why using this weapon-system?
Because you have 5 different types of munition changable with the key [N]
Types of munition:
- normal munition
- fire munition
- explosive munition
- armour-breaking munition
- special munition
Intro:
Clicking key [N] with a short duration, you will change the type of munition.
Clicking key [N] with a longer duration than ca. 1sec, you will open the weapon inventar and the included weapon shop.
You are only able to hold one weapon of any slot in your hand but you can also easily change the weapon of a slot by open the inventar and change the weapon.
So on there is a reloading animation to fix SAMP bugs while changing a weapon.
Video:
*********/v36qQqOUJIE
by BloodAngelHD
Other informations:
Type of saving system: MySQL
Language of the programm: Java (Shoebill)
Type of system: Plugin for the Shoebill Plugin
GitHub: github.com/Alf21/weapon-system.git
Thanks to @123marvin123 (for a lot of helping, Shoebill and the repo) and to BloodAngelHD (for the video)!
-> Why using Shoebill / Java?
Shoebill is faster than Pawn so there is a better performance. Its very important for this system because there is after every shoot a calculation.
In addition to that java has a great support and you can use your favourite IDEs such as Eclipse with Maven.
Effects of types of munition:
Name - Damage - Price
Normal - 50%* - 100%*
Fire - 1 [+ every second damage(+2)] - 10%*
Explosiv - 10%* (+ areadamage / damage of explosion**) - 250%*
Armour-breaking - 65%* (+ ignores armour of enemy) - 120%*
special - 120%* - 350%*
* of normal damage / price
** Distance of: 1 - 10 Damage, 2 - 5 Damage, 3 - 2 Damage, >4 - 0 Damage
Requirements:
Shoebill ([0.3.7] Shoebill 1.2 Plugin) + MySQL Database -> localhost or a vServer / root for using Shoebill
Installation:
1. Download from GitHub or add it with maven to you pom.xml (in the dependencies):
Код:
<dependency> <groupId>me.alf21</groupId> <artifactId>weapon-system</artifactId> <version>1.0-SNAPSHOT</version> <type>jar</type> <scope>compile</scope> </dependency>
2. add Plugin into folder shoebill/plugins and add in shoebill/resources.yml under "plugins:"
Код:
- me.alf21:weapon-system:1.0-SNAPSHOT
DONT re-release this system or change the credits, but you can ask me!
Callbacks:
Код:
//To give a weapon givePlayerWeapon(player, weaponId, ammo) //to reload a weapon completeky givePlayerNewWeapon(player, weaponId, ammo) //to load a weapon with the old munition data //To get munition getWeaponAmmo(player, weaponId) getFireWeaponAmmo(player, weaponId) getExplosiveWeaponAmmo(player, weaponId) getHeavyWeaponAmmo(player, weaponId) getSpecialWeaponAmmo(player, weaponId) //To set munition setWeaponAmmo(player, weaponId, ammo) setFireWeaponAmmo(player, weaponId, ammo) setExplosiveWeaponAmmo(player, weaponId, ammo) setHeavyWeaponAmmo(player, weaponId, ammo) setSpecialWeaponAmmo(player, weaponId, ammo) //To get current loaded type of munition getAmmoState(player, weaponId) //To set current loaded type of munition (ATTENTION: The player need to have the type of munition) setAmmoState(player, weaponId, ammoState) //To check whether the weapon is selected / armed isSelectedWeapon(player, weaponId) //To set a weapon selected / armed setSelectedWeapon(player, weaponId, bool) //To check whether is weapon is buyed / able to arm isAbleWeapon(player, weaponId) //To set a weapon able setAbleWeapon(player, weaponId, bool) //To set all weapon of a slot as not armed / unselected unselectWeapons(player, slot)
Alf21
//edit there was a link, but it was not detected because of no 'http://' (GitHub)