Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //package sa_mp_srv;
- import net.gtaun.shoebill.constant.WeaponModel;
- import net.gtaun.shoebill.data.WeaponData;
- public class Weapon extends WeaponData {
- private static final long serialVersionUID = 8903790067683232090L;
- public static enum WEAPON_SLOT
- {
- INVALID,
- HAND,
- MELEE,
- PISTOL,
- SHOTGUN,
- MACHINE_PISTOL,
- CARABINER,
- RIFLE,
- HEAVY,
- THROWABLE,
- MISC1,
- MISC2,
- WEARABLE,
- DETONATOR
- }
- public Weapon()
- {
- this.model = WeaponModel.NONE;
- this.ammo = 0;
- }
- public Weapon(WeaponData wd)
- {
- if(wd == null)
- {
- this.model = WeaponModel.NONE;
- this.ammo = 0;
- }
- else
- {
- this.model = wd.getModel();
- this.ammo = wd.getAmmo();
- }
- }
- public int getID()
- {
- return getIDByWeaponModel(this.model);
- }
- public static int getIDByWeaponModel(WeaponModel wm)
- {
- return (wm == null)?0:wm.compareTo(WeaponModel.NONE);
- }
- public WEAPON_SLOT getSlot()
- {
- return getSlotByWeaponModel(this.model);
- }
- public static WEAPON_SLOT getSlotByWeaponModel(WeaponModel wm)
- {
- WEAPON_SLOT ret;
- if(wm == null) ret = WEAPON_SLOT.INVALID;
- else
- {
- switch(wm)
- {
- case GOLFCLUB: case NITESTICK: case KNIFE: case BAT: case SHOVEL: case POOLSTICK: case KATANA: case CHAINSAW:
- ret = WEAPON_SLOT.MELEE;
- break;
- case COLT45: case SILENCED_COLT45: case DEAGLE:
- ret = WEAPON_SLOT.PISTOL;
- break;
- case SHOTGUN: case SAWEDOFF: case SHOTGSPA:
- ret = WEAPON_SLOT.SHOTGUN;
- break;
- case UZI: case MP5: case TEC9:
- ret = WEAPON_SLOT.MACHINE_PISTOL;
- break;
- case AK47: case M4:
- ret = WEAPON_SLOT.CARABINER;
- break;
- case RIFLE: case SNIPER:
- ret = WEAPON_SLOT.RIFLE;
- break;
- case ROCKETLAUNCHER: case HEATSEEKER: case FLAMETHROWER: case MINIGUN:
- ret = WEAPON_SLOT.HEAVY;
- break;
- case GRENADE: case TEARGAS: case MOLTOV: case SATCHEL:
- ret = WEAPON_SLOT.THROWABLE;
- break;
- case SPRAYCAN: case FIREEXTINGUISHER: case CAMERA:
- ret = WEAPON_SLOT.MISC1;
- case DILDO: case DILDO2: case VIBRATOR: case VIBRATOR2: case FLOWER: case CANE:
- ret = WEAPON_SLOT.MISC2;
- case NIGHTVISION: case INFRARED: case PARACHUTE:
- ret = WEAPON_SLOT.WEARABLE;
- break;
- case BOMB:
- ret = WEAPON_SLOT.DETONATOR;
- break;
- default:
- ret = WEAPON_SLOT.HAND;
- break;
- }
- }
- return ret;
- }
- public int getSlotID()
- {
- return getSlotIDByWeaponModel(this.model);
- }
- public static int getSlotIDByWeaponModel(WeaponModel wm)
- {
- return getSlotByWeaponModel(wm).compareTo(WEAPON_SLOT.HAND);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement