From 570dc75512e1f3ac46c33e891ddd9698564c53aa Mon Sep 17 00:00:00 2001 From: Michael McKoy Date: Tue, 18 Dec 2007 21:03:34 +0000 Subject: [PATCH] Added new stocks for entity props. --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401806 --- plugins/include/entity_prop_stocks.inc | 84 ++++++++++++++++++++++++++ plugins/include/sourcemod.inc | 1 + 2 files changed, 85 insertions(+) create mode 100644 plugins/include/entity_prop_stocks.inc diff --git a/plugins/include/entity_prop_stocks.inc b/plugins/include/entity_prop_stocks.inc new file mode 100644 index 00000000..28514566 --- /dev/null +++ b/plugins/include/entity_prop_stocks.inc @@ -0,0 +1,84 @@ +/** + * vim: set ts=4 : + * ============================================================================= + * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * ============================================================================= + * + * This file is part of the SourceMod/SourcePawn SDK. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, version 3.0, as published by the + * Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + * As a special exception, AlliedModders LLC gives you permission to link the + * code of this program (as well as its derivative works) to "Half-Life 2," the + * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software + * by the Valve Corporation. You must obey the GNU General Public License in + * all respects for all other code used. Additionally, AlliedModders LLC grants + * this exception to all derivative works. AlliedModders LLC defines further + * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), + * or . + * + * Version: $Id$ + */ + +#if defined _entity_prop_stocks_included + #endinput +#endif +#define _entity_prop_stocks_included + +enum +{ + MOVETYPE_NONE = 0, /** never moves */ + MOVETYPE_ISOMETRIC, /** For players */ + MOVETYPE_WALK, /** Player only - moving on the ground */ + MOVETYPE_STEP, /** gravity, special edge handling -- monsters use this */ + MOVETYPE_FLY, /** No gravity, but still collides with stuff */ + MOVETYPE_FLYGRAVITY, /** flies through the air + is affected by gravity */ + MOVETYPE_VPHYSICS, /** uses VPHYSICS for simulation */ + MOVETYPE_PUSH, /** no clip to world, push and crush */ + MOVETYPE_NOCLIP, /** No gravity, no collisions, still do velocity/avelocity */ + MOVETYPE_LADDER, /** Used by players only when going onto a ladder */ + MOVETYPE_OBSERVER, /** Observer movement, depends on player's observer mode */ + MOVETYPE_CUSTOM, /** Allows the entity to describe its own physics */ +}; + +/** + * Sets an entity's color. + * + * @param index Entity index + * @param mt Movetype, see enum above + * @noreturn + */ +stock SetEntityMovetype(index, mt) +{ + new offset = GetEntSendPropOffs(index, "movetype"); + SetEntData(index, offset, mt, 1, true); +} + +/** + * Sets an entity's color. + * + * @param index Entity index + * @param r Amount of red (0-255) + * @param g Amount of green (0-255) + * @param b Amount of blue (0-255) + * @param a Amount of alpha (0-255) + * @noreturn + */ +stock SetEntityRenderColor(index, r=255, g=255, b=255, a=255) +{ + new offset = GetEntSendPropOffs(index, "m_clrRender"); + SetEntData(index, offset, r, 1, true); + SetEntData(index, offset + 1, g, 1, true); + SetEntData(index, offset + 2, b, 1, true); + SetEntData(index, offset + 3, a, 1, true); +} \ No newline at end of file diff --git a/plugins/include/sourcemod.inc b/plugins/include/sourcemod.inc index aab0d7ab..a353b425 100644 --- a/plugins/include/sourcemod.inc +++ b/plugins/include/sourcemod.inc @@ -572,4 +572,5 @@ native SetMapListCompatBind(const String:name[], const String:file[]); #include #include +#include