Skip to content

Commit

Permalink
shop: added include
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistrick authored Sep 11, 2016
1 parent 0d52b88 commit 7f9cd4f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions include/deathrun_shop.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#if defined _deathrun_shop_included
#endinput
#endif
#define _deathrun_shop_included

#if AMXX_VERSION_NUM >= 175
#pragma reqlib deathrun_shop
#if !defined AMXMODX_NOAUTOLOAD
#pragma loadlib deathrun_shop
#endif
#else
#pragma library deathrun_shop
#endif

const ITEM_TEAM_T = (1 << 1);
const ITEM_TEAM_CT = (1 << 2);

/**
* Item registration in shop
*
* @param name Item name in menu
* @param cost Item cost
* @param team Team access, bitsum, use ITEM_TEAM_T, ITEM_TEAM_CT
* @param access Admin access, admin flags
* @param on_buy OnBuy function(id)
* @param can_buy CanBuy function(id), should return ITEM_ENABLED or ITEM_DISABLED
*
* @return Item index, use with changing cost
*/
native dr_shop_add_item(name[], cost, team = (ITEM_TEAM_T|ITEM_TEAM_CT), access = 0, on_buy[], can_buy[] = "");

/**
* Use this in CanBuy function
*
* @param addition Additional string in menu
*/
native dr_shop_item_addition(addition[]);

/**
* @param item Item index
* @param cost New item cost
*/
native dr_shop_set_item_cost(item, cost);

0 comments on commit 7f9cd4f

Please sign in to comment.