forked from UNLOZE/sm-plugins
entWatch4: fix includes, add EW_ClientHasItem
ReservedSlot: kick people with 0 idle time too, add back rule 4: alive non-donator, idle > 30, no item
This commit is contained in:
@@ -56,6 +56,7 @@ public APLRes AskPluginLoad2(Handle hMyself, bool bLate, char[] sError, int erro
|
||||
|
||||
CreateNative("EW_GetItemCount", Native_GetItemCount);
|
||||
CreateNative("EW_GetItemData", Native_GetItemData);
|
||||
CreateNative("EW_ClientHasItem", Native_ClientHasItem);
|
||||
|
||||
RegPluginLibrary("entWatch-core");
|
||||
return APLRes_Success;
|
||||
@@ -752,4 +753,34 @@ public int Native_GetItemData(Handle hPlugin, int numParams)
|
||||
}
|
||||
|
||||
return view_as<int>(g_hArray_Items.Get(index));
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public int Native_ClientHasItem(Handle hPlugin, int numParams)
|
||||
{
|
||||
int client = GetNativeCell(1);
|
||||
|
||||
if(client > MaxClients || client <= 0)
|
||||
{
|
||||
return ThrowNativeError(SP_ERROR_NATIVE, "Client is not valid.");
|
||||
}
|
||||
|
||||
if(!IsClientInGame(client))
|
||||
{
|
||||
ThrowNativeError(SP_ERROR_NATIVE, "Client is not in game.");
|
||||
}
|
||||
|
||||
for (int index; index < g_hArray_Items.Length; index++)
|
||||
{
|
||||
CItem item = g_hArray_Items.Get(index);
|
||||
|
||||
if (item.bClient && item.iClient == client)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user