[Plugin] [Shoebill] weapon-system
#1

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
Every type of munition has a different effect and amount of damage.

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>
Or download here: http://ci.gtaun.net/job/weapon-system/

2. add Plugin into folder shoebill/plugins and add in shoebill/resources.yml under "plugins:"
Код:
  - me.alf21:weapon-system:1.0-SNAPSHOT
Attention!:
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)
Please give a Feedback, thanks!

Alf21
//edit there was a link, but it was not detected because of no 'http://' (GitHub)
Reply
#2

Looks nice and everything but why did you make a plugin for it?
This is quite easy to do in Pawn also.
Reply
#3

@TwinkiDaBoss : I leaved PAWN because i started to learn Java and i liked to program object-oriented. So i found Shoebill and tried it out. 123maven123 supports me perfectly so i tried to program this system as my first Shoebill system to learn Java. Because of this, this system is pretty simple. But i don't believe that it's quite easy to do it with PAWN (maybe for you but not for all, eg beginners^^). Shoebill has a better performance because of Java and C++. So on there are some timers, a shop and weapon inventar, a weapon fix and different munition types you can own at the same time. In addition to that you can communicate with this plugin because of the plugin system of Shoebill.
But you are right, it is possible to write this system as an Include file for PAWN! (Oh: A plugin for Shoebill is nearly the same as a include for Pawn)

Thanks for your feedback, i like it!
Reply
#4

Read rules in this forum! You must post only with source code!
Reply
#5

Quote:
Originally Posted by AirKite
Посмотреть сообщение
Read rules in this forum! You must post only with source code!
Review the thread, he linked the source code.
Reply
#6

Quote:
Originally Posted by AirKite
Посмотреть сообщение
Read rules in this forum! You must post only with source code!
Maybe if you looked before instantly crying because "POST MUST ONLY BE WITH SOURCE CODE!!!!" you would notice that...
1. The source code is actually IN THE POST.
2. The rules don't say your post must be ONLY the source code, it only says it must have it. Read the rules before you complain.
Reply
#7

Nice, I like it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)