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;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
/* CLASSES */
|
||||
#include <basic>
|
||||
#include "../classes/CConfig.inc"
|
||||
#include "../classes/CItem.inc"
|
||||
#include "entWatch/CConfig.inc"
|
||||
#include "entWatch/CItem.inc"
|
||||
|
||||
public SharedPlugin __pl_entWatch_core =
|
||||
{
|
||||
@@ -44,6 +44,7 @@ public SharedPlugin __pl_entWatch_core =
|
||||
{
|
||||
MarkNativeAsOptional("EW_GetItemCount");
|
||||
MarkNativeAsOptional("EW_GetItemData");
|
||||
MarkNativeAsOptional("EW_ClientHasItem");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -51,6 +52,8 @@ native int EW_GetItemCount();
|
||||
|
||||
native CItem EW_GetItemData(int index);
|
||||
|
||||
native bool EW_ClientHasItem(int client);
|
||||
|
||||
forward void EW_OnClientItemDrop(int client, int index);
|
||||
forward void EW_OnClientItemDeath(int client, int index);
|
||||
forward void EW_OnClientItemPickup(int client, int index);
|
||||
@@ -58,4 +61,4 @@ forward void EW_OnClientItemActivate(int client, int index);
|
||||
forward void EW_OnClientItemDisconnect(int client, int index);
|
||||
|
||||
forward Action EW_OnClientItemCanPickup(int client, int index);
|
||||
forward Action EW_OnClientItemCanActivate(int client, int index);
|
||||
forward Action EW_OnClientItemCanActivate(int client, int index);
|
||||
|
||||
Reference in New Issue
Block a user