* This plugin is a bunch of extra items; all of them are
licenses.
* Has is own
INC with its natives, in order to make it possible to need a license to buy a extra weapons.
* There are
5 licenses (
Heavy,
Sub,
Rifle,
Pistols and
Shotguns) Edit:
6 licenses; added
golden
* You need to edit your extra items (or custom menus) to make them compatible with licenses.
* Once you have purchased one license, you will have them
until the end of the map.
Main plugin (
OBLIGATORY): zp_licenses
Inc (
OBLIGATORY): licenses
Simple example of how to do a extra item with licenses:
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <cstrike>
#include <fun>
#include <licenses> // This include contains the licenses' natives
#define PLUGIN "This is just an example"
#define VERSION "1.0"
#define AUTHOR "Sergicruz"
// From here nothing important...
new g_mac10
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
g_mac10 = zp_register_extra_item("Mac10 + 200B", 7, ZP_TEAM_HUMAN)
}
// YOU HAVE TO DO THE MODIFICATIONS HERE
public zp_extra_item_selected(id, itemid)
{
if(itemid == g_mac10)
{
if(!zp_has_user_subs_license(id)) // If user hasn't subs license...
{
client_print(id, print_chat, "You need subs license") // we tell him that he needs it
zp_set_user_ammo_packs(id, (zp_get_user_ammo_packs(id) + 7)) //and we give back his ammopacks
}
else{ //in other case...
give_item(id, "weapon_mac10") //we make him happy
cs_set_user_bpammo(id, CSW_MAC10, 200) // very happy
}
}
}
Credits:
* Rak: for explaining me how to use natives
* Mercylezz: for his awesome zombie plague
* Ciio: For explaining how to do a simple extra item
* H.Red.Zone: For his help improving the code
* Gogicaa: For helping me with spelling (

)
Cooming soon...
* Golden license (or similar)
Done
* Cvars for enable/disable licenses
* Natives for detect wether are licenses enabled or disabled
* Natives for giving licenses
Done
CHANGELOG:
* First release
20/9/12 13:22
* As H.Red.Zone suggested, added library
20/9/2012 17:45
* As H.Red.Zone suggested, added DEFINE for license cost
20/9/2012 18:03
* Added golden license (give all licenses)
11/2/2013 20:51
* Added natives for giving licenses
11/2/2013 20:51