THIS IS A TUTORIAL FOR ZOMBIE PLAGUE 5.0:
1ST. Manage included files
PHP Code:
#include <amxmodx>
#include <zp50_core> // engine
#include <zp50_items> // extra items
#include <zp50_class_nemesis> // nemesis
#include <zp50_class_survivor> // survivor
2ND. Make an item's id and register it in plugin_precache()
PHP Code:
new g_item_id
public plugin_prechache()
{
g_item_id = zp_items_register("<name>", <cost>) // no more teams!
}
3RD. If you want the item for only one team(human/survivor/nemesis/zombie) the make make a forward (
more here):
PHP Code:
public zp_fw_items_select_pre(id, itemid, ignorecost)
{
//check our item id
if (itemid == g_item_id)
{
// if you want it for only nemesis use this:
if (zp_core_is_zombie(id) && !zp_core_is_zombie(id) && zp_class_survivor_get(id))
{
// Return values
return ZP_ITEM_DONT_SHOW;
}
}
// here the main extra item's return value (if you want it to exist or not)
return ZP_ITEM_AVAILABLE;
}
4Th. When i player was succesfully buyed a extra item
PHP Code:
public zp_fw_items_select_post(id, itemid, ignorecost)
{
// check our extra item
if (itemid == g_item_id)
{
// do your command
}
// should always have a return value for sure
return ZP_ITEM_AVAILABLE;
}
Quote:
Any way in zp50's forwards if you are blocking use "return;" value
|
__________________