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:
@@ -0,0 +1,209 @@
|
||||
#if defined entWatch_class_config_included
|
||||
#endinput
|
||||
#endif
|
||||
|
||||
#define entWatch_class_config_included
|
||||
|
||||
methodmap CConfig < Basic
|
||||
{
|
||||
public CConfig()
|
||||
{
|
||||
Basic myclass = new Basic();
|
||||
|
||||
myclass.SetString("sName", "");
|
||||
myclass.SetString("sShort", "");
|
||||
myclass.SetString("sColor", "");
|
||||
myclass.SetString("sFilter", "");
|
||||
|
||||
myclass.SetInt("iButtonID", 0);
|
||||
myclass.SetInt("iConfigID", 0);
|
||||
myclass.SetInt("iWeaponID", 0);
|
||||
myclass.SetInt("iTriggerID", 0);
|
||||
|
||||
myclass.SetInt("iDisplay", 0);
|
||||
myclass.SetInt("iSlot", 0);
|
||||
myclass.SetInt("iMode", 0);
|
||||
|
||||
myclass.SetInt("iMaxUses", 0);
|
||||
myclass.SetInt("iCooldown", 0);
|
||||
|
||||
return view_as<CConfig>(myclass);
|
||||
}
|
||||
|
||||
|
||||
public bool GetName(char[] buffer, int length)
|
||||
{
|
||||
return this.GetString("sName", buffer, length);
|
||||
}
|
||||
|
||||
public void SetName(const char[] buffer)
|
||||
{
|
||||
this.SetString("sName", buffer);
|
||||
}
|
||||
|
||||
public bool GetShort(char[] buffer, int length)
|
||||
{
|
||||
return this.GetString("sShort", buffer, length);
|
||||
}
|
||||
|
||||
public void SetShort(const char[] buffer)
|
||||
{
|
||||
this.SetString("sShort", buffer);
|
||||
}
|
||||
|
||||
public bool GetColor(char[] buffer, int length)
|
||||
{
|
||||
return this.GetString("sColor", buffer, length);
|
||||
}
|
||||
|
||||
public void SetColor(const char[] buffer)
|
||||
{
|
||||
this.SetString("sColor", buffer);
|
||||
}
|
||||
|
||||
public bool GetFilter(char[] buffer, int length)
|
||||
{
|
||||
return this.GetString("sFilter", buffer, length);
|
||||
}
|
||||
|
||||
public void SetFilter(const char[] buffer)
|
||||
{
|
||||
this.SetString("sFilter", buffer);
|
||||
}
|
||||
|
||||
|
||||
property int iButtonID
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iButtonID");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iButtonID", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iConfigID
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iConfigID");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iConfigID", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iWeaponID
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iWeaponID");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iWeaponID", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iTriggerID
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iTriggerID");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iTriggerID", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
property int iDisplay
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iDisplay");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iDisplay", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iSlot
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iSlot");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iSlot", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iMode
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iMode");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iMode", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
property int iMaxUses
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iMaxUses");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iMaxUses", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iCooldown
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iCooldown");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iCooldown", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
property bool bDisplayEventMessages
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return view_as<bool>(this.iDisplay & (1<<0));
|
||||
}
|
||||
}
|
||||
|
||||
property bool bDisplayActivateMessages
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return view_as<bool>(this.iDisplay & (1<<1));
|
||||
}
|
||||
}
|
||||
|
||||
property bool bDisplayInterface
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return view_as<bool>(this.iDisplay & (1<<2));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
#if defined entWatch_class_item_included
|
||||
#endinput
|
||||
#endif
|
||||
|
||||
#define entWatch_class_item_included
|
||||
|
||||
methodmap CItem < Basic
|
||||
{
|
||||
public CItem(CConfig value = view_as<CConfig>(INVALID_HANDLE))
|
||||
{
|
||||
Basic myclass = new Basic();
|
||||
|
||||
myclass.SetHandle("dConfig", value);
|
||||
|
||||
myclass.SetInt("iClient", INVALID_ENT_REFERENCE);
|
||||
myclass.SetInt("iButton", INVALID_ENT_REFERENCE);
|
||||
myclass.SetInt("iWeapon", INVALID_ENT_REFERENCE);
|
||||
myclass.SetInt("iTrigger", INVALID_ENT_REFERENCE);
|
||||
|
||||
myclass.SetInt("iTimesUsed", 0);
|
||||
myclass.SetFloat("flTimeReady", 0.0);
|
||||
|
||||
myclass.SetFloat("flWait", 0.0);
|
||||
|
||||
return view_as<CItem>(myclass);
|
||||
}
|
||||
|
||||
|
||||
property CConfig dConfig
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return view_as<CConfig>(this.GetHandle("dConfig"));
|
||||
}
|
||||
public set(CConfig value)
|
||||
{
|
||||
this.SetHandle("dConfig", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
property int iClient
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iClient");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iClient", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iButton
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iButton");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iButton", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iWeapon
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iWeapon");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iWeapon", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iTrigger
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iTrigger");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iTrigger", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
property int iTimesUsed
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iTimesUsed");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iTimesUsed", value);
|
||||
}
|
||||
}
|
||||
|
||||
property float flTimeReady
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetFloat("flTimeReady");
|
||||
}
|
||||
public set(float value)
|
||||
{
|
||||
this.SetFloat("flTimeReady", value);
|
||||
}
|
||||
}
|
||||
|
||||
property float flWait
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetFloat("flWait");
|
||||
}
|
||||
public set(float value)
|
||||
{
|
||||
this.SetFloat("flWait", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
property bool bClient
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return view_as<bool>(this.iClient != INVALID_ENT_REFERENCE);
|
||||
}
|
||||
}
|
||||
|
||||
property bool bButton
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return view_as<bool>(this.iButton != INVALID_ENT_REFERENCE);
|
||||
}
|
||||
}
|
||||
|
||||
property bool bWeapon
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return view_as<bool>(this.iWeapon != INVALID_ENT_REFERENCE);
|
||||
}
|
||||
}
|
||||
|
||||
property bool bTrigger
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return view_as<bool>(this.iTrigger != INVALID_ENT_REFERENCE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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