#include #include "W3SIncs/War3Source_Interface" //new bool:playerOwnsItem[MAXPLAYERSCUSTOM][MAXITEMS]; new playerOwnsItemExpireTime[MAXPLAYERSCUSTOM][MAXITEMS]; new Handle:g_OnItemPurchaseHandle; new Handle:g_OnItemLostHandle; new Handle:hitemRestrictionCvar; //new Handle:hCvarMaxShopitems2; public Plugin:myinfo= { name="W3S Engine Item2 Ownership", author="Ownz (DarkEnergy)", description="War3Source Core Plugins", version="1.0", url="http://war3source.com/" }; public OnPluginStart() { hitemRestrictionCvar=CreateConVar("war3_item_restrict","","Disallow items in shopmenu, shortname separated by comma only ie:'claw,orb'"); //hCvarMaxShopitems2=CreateConVar("war3_max_shopitems2","2"); } public bool:InitNativesForwards() { g_OnItemPurchaseHandle=CreateGlobalForward("OnItem2Purchase",ET_Ignore,Param_Cell,Param_Cell); g_OnItemLostHandle=CreateGlobalForward("OnItem2Lost",ET_Ignore,Param_Cell,Param_Cell); CreateNative("W3IsItem2DisabledGlobal",NW3IsItemDisabledGlobal); CreateNative("W3IsItem2DisabledForRace",NW3IsItemDisabledForRace); CreateNative("W3GetItem2ExpireTime",NW3GetItem2ExpireTime); CreateNative("W3SetItem2ExpireTime",NW3SetItem2ExpireTime); CreateNative("GetClientItems2Owned",NGetClientItems2Owned); //CreateNative("GetMaxShopitems2PerPlayer",NGetMaxShopitems2PerPlayer); return true; } public NW3IsItemDisabledGlobal(Handle:plugin,numParams) { new itemid=GetNativeCell(1); decl String:itemShort[16]; W3GetItem2Shortname(itemid,itemShort,16); decl String:cvarstr[100]; decl String:exploded[MAXITEMS][16]; decl num; GetConVarString(hitemRestrictionCvar,cvarstr,sizeof(cvarstr)); if(strlen(cvarstr)>0){ num=ExplodeString(cvarstr,",",exploded,MAXITEMS,16); for(new i=0;i0){ decl String:itemShort[16]; W3GetItem2Shortname(itemid,itemShort,sizeof(itemShort)); decl String:cvarstr[100]; decl String:exploded[MAXITEMS][16]; W3GetRaceItem2RestrictionsStr(raceid,cvarstr,sizeof(cvarstr)); new num; if(strlen(cvarstr)>0){ num=ExplodeString(cvarstr,",",exploded,MAXITEMS,16); for(new i=0;i