forked from UNLOZE/sm-plugins
Remove CSGO and Cleanup required folders.
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
#if defined entWatch_core_included
|
||||
#endinput
|
||||
#endif
|
||||
|
||||
#define entWatch_core_included
|
||||
|
||||
/* REGISTERS */
|
||||
#define REGISTER_WEAPON 1
|
||||
#define REGISTER_BUTTON 2
|
||||
#define REGISTER_TRIGGER 3
|
||||
|
||||
/* SLOTS */
|
||||
#define SLOT_NONE 0
|
||||
#define SLOT_PRIMARY 1
|
||||
#define SLOT_SECONDARY 2
|
||||
#define SLOT_KNIFE 3
|
||||
#define SLOT_GRENADES 4
|
||||
|
||||
/* MODES */
|
||||
#define MODE_COOLDOWN 1
|
||||
#define MODE_MAXUSES 2
|
||||
#define MODE_COOLDOWNMAXUSES 3
|
||||
#define MODE_COOLDOWNCHARGES 4
|
||||
|
||||
/* CLASSES */
|
||||
#include <basic>
|
||||
#include "../classes/CConfig.inc"
|
||||
#include "../classes/CItem.inc"
|
||||
|
||||
public SharedPlugin __pl_entWatch_core =
|
||||
{
|
||||
name = "entWatch-core",
|
||||
file = "entWatch-core.smx",
|
||||
|
||||
#if defined REQUIRE_PLUGIN
|
||||
required = 1
|
||||
#else
|
||||
required = 0
|
||||
#endif
|
||||
};
|
||||
|
||||
#if !defined REQUIRE_PLUGIN
|
||||
public void __pl_entWatch_core_SetNTVOptional()
|
||||
{
|
||||
MarkNativeAsOptional("EW_GetItemCount");
|
||||
MarkNativeAsOptional("EW_GetItemData");
|
||||
}
|
||||
#endif
|
||||
|
||||
native int EW_GetItemCount();
|
||||
|
||||
native CItem EW_GetItemData(int index);
|
||||
|
||||
forward void EW_OnClientItemDrop(int client, int index);
|
||||
forward void EW_OnClientItemDeath(int client, int index);
|
||||
forward void EW_OnClientItemPickup(int client, int index);
|
||||
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);
|
||||
@@ -0,0 +1,132 @@
|
||||
#if defined entWatch_helpers_included
|
||||
#endinput
|
||||
#endif
|
||||
|
||||
#define entWatch_helpers_included
|
||||
|
||||
/**
|
||||
* Converts the whole String to lower case.
|
||||
* Only works with alphabetical characters (not ײִ) because Sourcemod suxx !
|
||||
* The Output String can be the same as the Input String.
|
||||
*
|
||||
* @param input Input String.
|
||||
* @param output Output String.
|
||||
* @param size Max Size of the Output string
|
||||
* @noreturn
|
||||
*/
|
||||
stock void String_ToLower(const char[] input, char[] output, int size)
|
||||
{
|
||||
size--;
|
||||
|
||||
int x;
|
||||
while (input[x] != '\0' || x < size) {
|
||||
|
||||
if (IsCharUpper(input[x])) {
|
||||
output[x] = CharToLower(input[x]);
|
||||
}
|
||||
else {
|
||||
output[x] = input[x];
|
||||
}
|
||||
|
||||
x++;
|
||||
}
|
||||
|
||||
output[x] = '\0';
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the specified index is a player and connected.
|
||||
*
|
||||
* @param entity An entity index.
|
||||
* @param checkConnected Set to false to skip the IsClientConnected check
|
||||
* @return Returns true if the specified entity index is a player connected, false otherwise.
|
||||
*/
|
||||
stock bool Client_IsValid(int client, bool checkConnected=true)
|
||||
{
|
||||
if (client > 4096) {
|
||||
client = EntRefToEntIndex(client);
|
||||
}
|
||||
|
||||
if (client < 1 || client > MaxClients) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (checkConnected && !IsClientConnected(client)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the client's current observer target entity.
|
||||
*
|
||||
* @param client Client Index.
|
||||
* @return Observed Entity Index.
|
||||
*/
|
||||
stock int Client_GetObserverTarget(int client)
|
||||
{
|
||||
return GetEntPropEnt(client, Prop_Send, "m_hObserverTarget");
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if an entity is valid and exists.
|
||||
*
|
||||
* @param entity Entity Index.
|
||||
* @return True if the entity is valid, false otherwise.
|
||||
*/
|
||||
stock bool Entity_IsValid(int entity)
|
||||
{
|
||||
return IsValidEntity(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Hammer-ID of an entity.
|
||||
* The Hammer Editor gives every entity a unique ID.
|
||||
* Note: Old maps don't have Hammer-ID's set for entities
|
||||
*
|
||||
* @param entity Entity index.
|
||||
* @return Hammer ID.
|
||||
*/
|
||||
stock int Entity_GetHammerID(int entity)
|
||||
{
|
||||
return GetEntProp(entity, Prop_Data, "m_iHammerID");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the owner of an entity.
|
||||
* For example the owner of a weapon entity.
|
||||
*
|
||||
* @param entity Entity index.
|
||||
* @return Ground Entity or -1
|
||||
*/
|
||||
stock int Entity_GetOwner(int entity)
|
||||
{
|
||||
return GetEntPropEnt(entity, Prop_Data, "m_hOwnerEntity");
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets the parent entity of an entity.
|
||||
*
|
||||
* @param entity Entity Index.
|
||||
* @return Entity Index of the parent.
|
||||
*/
|
||||
stock int Entity_GetParent(int entity)
|
||||
{
|
||||
return GetEntPropEnt(entity, Prop_Data, "m_pParent");
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Name of an entity.
|
||||
*
|
||||
* @param entity Entity index.
|
||||
* @param name The name you want to give.
|
||||
* @noreturn
|
||||
*/
|
||||
stock void Entity_SetName(int entity, const char[] name, any ...)
|
||||
{
|
||||
char format[128];
|
||||
VFormat(format, sizeof(format), name, 3);
|
||||
|
||||
DispatchKeyValue(entity, "targetname", format);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#if defined entWatch_restrictions_included
|
||||
#endinput
|
||||
#endif
|
||||
|
||||
#define entWatch_restrictions_included
|
||||
|
||||
public SharedPlugin __pl_entWatch_restrictions =
|
||||
{
|
||||
name = "entWatch-restrictions",
|
||||
file = "entWatch-restrictions.smx",
|
||||
|
||||
#if defined REQUIRE_PLUGIN
|
||||
required = 1
|
||||
#else
|
||||
required = 0
|
||||
#endif
|
||||
};
|
||||
|
||||
#if !defined REQUIRE_PLUGIN
|
||||
public void __pl_entWatch_restrictions_SetNTVOptional()
|
||||
{
|
||||
MarkNativeAsOptional("EW_ClientRestrict");
|
||||
MarkNativeAsOptional("EW_ClientUnrestrict");
|
||||
MarkNativeAsOptional("EW_ClientRestricted");
|
||||
}
|
||||
#endif
|
||||
|
||||
native bool EW_ClientRestrict(int client, int target, int length);
|
||||
native bool EW_ClientUnrestrict(int client, int target);
|
||||
native bool EW_ClientRestricted(int client);
|
||||
|
||||
forward void EW_OnClientRestricted(int client, int target, int length);
|
||||
forward void EW_OnClientUnrestricted(int client, int target);
|
||||
Reference in New Issue
Block a user