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.