forked from UNLOZE/sm-plugins
entWatch4: Add native, and comment old code.
This commit is contained in:
@@ -52,6 +52,7 @@ public APLRes AskPluginLoad2(Handle hMyself, bool bLate, char[] sError, int erro
|
||||
g_bLate = bLate;
|
||||
|
||||
CreateNative("EW_GetItemCount", Native_GetItemCount);
|
||||
CreateNative("EW_GetItemData", Native_GetItemData);
|
||||
|
||||
RegPluginLibrary("entWatch-core");
|
||||
return APLRes_Success;
|
||||
@@ -616,4 +617,19 @@ public Action OnWeaponTouch(int client, int weapon)
|
||||
public int Native_GetItemCount(Handle hPlugin, int numParams)
|
||||
{
|
||||
return g_hArray_Items.Length;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public int Native_GetItemData(Handle hPlugin, int numParams)
|
||||
{
|
||||
int index = GetNativeCell(1);
|
||||
|
||||
if ((index < 0) || (index > g_hArray_Items.Length))
|
||||
{
|
||||
return ThrowNativeError(SP_ERROR_INDEX, "Item index %d is invalid.", index);
|
||||
}
|
||||
|
||||
return view_as<int>(g_hArray_Items.Get(index));
|
||||
}
|
||||
Reference in New Issue
Block a user