Raised This Month: $51 Target: $400
 12% 

[VWS] Virtual Weapon Slots - (ie. Multiple AKs at same time)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 09-12-2023 , 14:08   [VWS] Virtual Weapon Slots - (ie. Multiple AKs at same time)
Reply With Quote #1

Virtual Weapon Slots
- v0.0.1, posted at : 12/09/2023

This is a beta version of my new project. Now you can use more than 2 of the same weapons. For example, you can have 2 special AKs or AWPs.
Even if you drop your AK, when you pick it up you will be able to reopen the menu and switch your AK.

Short Video

If you want this to run Zombie Plague or any other mod you will need to edit this and recompile.
Code:
//#include <zombieplague>

// ------------ CHECK CONDITION  ----------- //
// By default this plugin was designed for Furien Supreme mod
#define CHECK_CONDITION(%1)	cs_get_user_team(%1) == CS_TEAM_CT
// If you are running zombie plague alternate the Check condition for who is allowed to open the menu
//#define CHECK_CONDITION(%1)	!(zp_get_user_survivor(%1) && zp_get_user_zombie(%1) && zp_get_user_nemesis(%1))


//-------------- MENU STARTUP ------------- //
// By default you open the menu by using Flashlight
#define MENU_STARTUP register_impulse(100, "Cmd__OpenMenu")
//If you want you can change it to Nightvision or any other command by your choice:
//#define MENU_STARTUP register_clcmd("nightvision", "Cmd__OpenMenu")
Include File
Code:
#if defined _virtual_weapon_slots_included
  #endinput
#endif
#define _virtual_weapon_slots_included

/**
 * Register Weapons
 *
 * @param szName	Name on Menu
 * @param iCSW		CSW_ of weapon
 * @return		An internal Weapon Index
 */
native virtual_weapon_register(const szName[], iCSW)

/**
 * Give weapon
 *
 * @param Id		Player Index
 * @param iSlot		Weapon Internal Index
 * @param iCSW		Weapon default ID
 */
native virtual_weapon_give(id, iSlot, iCSW)

/**
 * Remove Weapon
 *
 * @param Id		Player Index
 * @param iSlot		Weapon Internal Index
 * @param iCSW		Weapon default ID
 */
native virtual_weapon_take(id, iSlot, iCSW)

/**
 * Checks if user has the weapon (Holding or not holding)
 *
 * @param Id		Player Index
 * @param iSlot		Weapon Internal Index
 */
native virtual_weapon_user_has(id, iSlot)

/**
 * Gets the Weapon's Internal Index
 *
 * @param Id		Player Index
 */
native Float:virtual_weapon_get_current(id)


Despite this is not 100% finish, the main point of the plugin is working. And for that reason i am releasing it as a beta version so you can start using it.
Attached Files
File Type: inc virtual_weapon_slots.inc (969 Bytes, 89 views)
File Type: txt virtual_weapon_slots.txt (589 Bytes, 85 views)
File Type: sma Get Plugin or Get Source (virtual_weapon_slots.sma - 127 views - 6.2 KB)
__________________

Last edited by Jhob94; 09-12-2023 at 17:29. Reason: quick edit
Jhob94 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 09-12-2023 , 14:09   Re: [VWS] Virtual Weapon Slots
Reply With Quote #2

This is a short example, later i will go into more details and using models. Now it's dinner time
Code:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <virtual_weapon_slots>

#define PLUGIN "grdgd"
#define VERSION "0.0.1"
#define AUTHOR "Jhob94"

new AK1, AK2

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /ak", "giveak")
	register_clcmd("say /ak2", "giveak2")
	AK1 = virtual_weapon_register("AK 1", CSW_AK47)
	AK2 = virtual_weapon_register("AK 2", CSW_AK47)
}

public giveak(id)
{
	give_item(id, "weapon_ak47")
	virtual_weapon_give(id, AK1, CSW_AK47)
}

public giveak2(id)
{
	give_item(id, "weapon_ak47")
	virtual_weapon_give(id, AK2, CSW_AK47)
}
__________________
Jhob94 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 09-12-2023 , 17:27   Re: [VWS] Virtual Weapon Slots - (ie. Multiple AKs at same time)
Reply With Quote #3

I am posting here 2 zombie plague M4A1's. It was a fast edit.
Feel free to test them.
Attached Files
File Type: sma Get Plugin or Get Source (zp_thunder_carabine.sma - 87 views - 9.4 KB)
File Type: sma Get Plugin or Get Source (zp_golden_m4a1.sma - 81 views - 5.5 KB)
File Type: zip Thunder carabine.zip (1.98 MB, 48 views)
File Type: zip goldm4a1.zip (3.33 MB, 65 views)
__________________
Jhob94 is offline
Hakim Azizov
Member
Join Date: Mar 2023
Old 09-15-2023 , 14:05   Re: [VWS] Virtual Weapon Slots - (ie. Multiple AKs at same time)
Reply With Quote #4

Quote:
Originally Posted by Jhob94 View Post
I am posting here 2 zombie plague M4A1's. It was a fast edit.
Feel free to test them.
Excellent work bro) You are a G.O.A.T!
Hakim Azizov is offline
DeMNiX
Veteran Member
Join Date: Nov 2011
Location: Russia
Old 11-20-2023 , 01:48   Re: [VWS] Virtual Weapon Slots - (ie. Multiple AKs at same time)
Reply With Quote #5

by this way harder to save some data from custom weapons
better to "play" with custom var_classnames or like medusa's molotov example try to use rg_defaultdeploy & ham_item_deploy hooks from devcs : pastebin.com/iAU3PAmw
__________________
My channel with test codes
https://www.youtube.com/user/demnix03

Zombie Riot [Scenario & bots-zombie 11.11.2023]
https://youtu.be/8ZZan-aq2sc
DeMNiX is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 11-20-2023 , 04:17   Re: [VWS] Virtual Weapon Slots - (ie. Multiple AKs at same time)
Reply With Quote #6

I'll keep it the way it is. When i get back on this plugin i will add data saving feature.
__________________
Jhob94 is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 12-22-2023 , 16:28   Re: [VWS] Virtual Weapon Slots - (ie. Multiple AKs at same time)
Reply With Quote #7

Quote:
Originally Posted by DeMNiX View Post
by this way harder to save some data from custom weapons
better to "play" with custom var_classnames or like medusa's molotov example try to use rg_defaultdeploy & ham_item_deploy hooks from devcs : pastebin.com/iAU3PAmw
That looks like it's dependent on reapi, which is a no go at least for me. Impressive videos on your channel btw, got yourself a subscriber.

Jhob, very good job and thank you very much for sharing this. Will come back with feedback after i give it a run.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode