AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Help with zephyrus store include's new syntax (https://forums.alliedmods.net/showthread.php?t=317605)

Cruze 07-21-2019 06:05

Help with zephyrus store include's new syntax
 
PHP Code:

#if defined _store_included
    #endinput
#endif
#define _store_included

new g_cvarChatTag = -1;

#define ITEM_NAME_LENGTH 64
#define STORE_MAX_ITEMS 2048
#define STORE_MAX_HANDLERS 64
#define STORE_MAX_PLANS 8
#define STORE_MAX_SLOTS 4

enum Item_Plan
{
    
String:szName[ITEM_NAME_LENGTH],
    
iPrice,
    
iTime
}

enum Store_Item
{
    
String:szName[ITEM_NAME_LENGTH],
    
String:szUniqueId[PLATFORM_MAX_PATH],
    
String:szShortcut[64],
    
iId,
    
iPrice,
    
iParent,
    
iHandler,
    
iFlagBits,
    
iData,
    
iPlans,
    
bool:bBuyable,
    
bool:bIgnoreVIP,
    
Handle:hAttributes
}

enum Type_Handler
{
    
String:szType[64],
    
String:szUniqueKey[32],
    
bool:bEquipable,
    
bool:bRaw,
    
Handle:hPlugin,
    Function:
fnMapStart,
    Function:
fnReset,
    Function:
fnConfig,
    Function:
fnUse,
    Function:
fnRemove
}

enum Client_Item
{
    
iId,
    
iUniqueId,
    
bool:bSynced,
    
bool:bDeleted,
    
iDateOfPurchase,
    
iDateOfExpiration,
    
iPriceOfPurchase,
}

native Store_RegisterHandler(String:type[], String:uniquekey[], Function:mapstart, Function:reset, Function:config, Function:use, Function:removebool:equipable truebool:raw false);
native Store_RegisterMenuHandler(String:identifier[], Function:menu, Function:handler);
native Store_SetDataIndex(itemidindex);
native Store_GetDataIndex(itemid);
native Store_GetEquippedItem(clientString:type[], slot=0);
native Store_IsClientLoaded(client);
native Store_DisplayPreviousMenu(client);
native Store_SetClientMenu(clientnum);
native Store_GetClientCredits(client);
native Store_SetClientCredits(clientcredits);
native Store_IsClientVIP(client);
native Store_IsItemInBoughtPackage(clientitemiduid=-1);
native Store_ShouldConfirm();
native Store_DisplayConfirmMenu(clientString:title[], Function:callbackdata);
native Store_GetItem(itemidoutput[Store_Item]);
native Store_GetHandler(indexoutput[Type_Handler]);
native Store_GiveItem(clientitemidpurchase=0expiration=0price=0);
native Store_RemoveItem(clientitemid);
native Store_GetClientItem(clientitemidoutput[Client_Item]);
native Store_GetClientTarget(client);
native Store_GiveClientItem(clientrecipientitemid);
native Store_HasClientItem(clientitemid);
native Store_IterateEquippedItems(client, &startbool:attributes=false);

forward Store_OnClientModelChanged(clientString:model[]);

public 
Extension:__ext_store_sm =
{
    
name "Store - The Resurrection",
    
file "store_sm.ext",
#if defined AUTOLOAD_EXTENSIONS
    
autoload 1,
#else
    
autoload 0,
#endif
    
required 0,
}; 

My bad try :s XD :
PHP Code:

#if defined _store_included
    #endinput
#endif
#define _store_included

int g_cvarChatTag = -1;

#define ITEM_NAME_LENGTH 64
#define STORE_MAX_ITEMS 2048
#define STORE_MAX_HANDLERS 64
#define STORE_MAX_PLANS 8
#define STORE_MAX_SLOTS 4

enum Item_Plan
{
    
char szName[ITEM_NAME_LENGTH],
    
iPrice,
    
iTime
}

enum Store_Item
{
    
char  szName[ITEM_NAME_LENGTH],
    
char szUniqueId[PLATFORM_MAX_PATH],
    
char szShortcut[64],
    
iId,
    
iPrice,
    
iParent,
    
iHandler,
    
iFlagBits,
    
iData,
    
iPlans,
    
bool bBuyable,
    
bool bIgnoreVIP,
    
Handle hAttributes
}

enum Type_Handler
{
    
char szType[64],
    
char szUniqueKey[32],
    
bool bEquipable,
    
bool bRaw,
    
Handle hPlugin,
    Function 
fnMapStart,
    Function 
fnReset,
    Function 
fnConfig,
    Function 
fnUse,
    Function 
fnRemove
}

enum Client_Item
{
    
iId,
    
iUniqueId,
    
bool bSynced,
    
bool bDeleted,
    
iDateOfPurchase,
    
iDateOfExpiration,
    
iPriceOfPurchase,
}

native Store_RegisterHandler(char[] typechar[] uniquekey, Function mapstart, Function reset, Function config, Function use, Function removebool equipable truebool raw false);
native Store_RegisterMenuHandler(char[] identifier, Function menu, Function handler);
native Store_SetDataIndex(int itemidint index);
native Store_GetDataIndex(int itemid);
native Store_GetEquippedItem(int clientchar[] typeint slot=0);
native Store_IsClientLoaded(int client);
native Store_DisplayPreviousMenu(int client);
native Store_SetClientMenu(int clientint num);
native Store_GetClientCredits(int client);
native Store_SetClientCredits(int clientint credits);
native Store_IsClientVIP(int client);
native Store_IsItemInBoughtPackage(int clientint itemidint uid=-1);
native Store_ShouldConfirm();
native Store_DisplayConfirmMenu(int clientchar title[], Function callbackint data);
native Store_GetItem(int itemidint output[Store_Item]);
native Store_GetHandler(int indexint output[Type_Handler]);
native Store_GiveItem(int clientint itemidint purchase=0int expiration=0int price=0);
native Store_RemoveItem(int clientint itemid);
native Store_GetClientItem(int clientint itemidint output[Client_Item]);
native Store_GetClientTarget(int client);
native Store_GiveClientItem(int clientint recipientint itemid);
native Store_HasClientItem(int clientint itemid);
native Store_IterateEquippedItems(int clientint &startbool attributes=false);

forward Store_OnClientModelChanged(int clientchar model[]);

public 
Extension:__ext_store_sm =
{
    
name "Store - The Resurrection",
    
file "store_sm.ext",
#if defined AUTOLOAD_EXTENSIONS
    
autoload 1,
#else
    
autoload 0,
#endif
    
required 0,
}; 


Powerlord 07-22-2019 12:27

Re: Help with zephyrus store include's new syntax
 
Those enums are actually enum structs. If you want to use new syntax for them, check out the SourceMod 1.10 support for enum structs.


All times are GMT -4. The time now is 07:05.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.