1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/cssdm_utils.h Sun Jun 24 21:58:09 2007 +0000
1.3 @@ -0,0 +1,69 @@
1.4 +/**
1.5 + * vim: set ts=4 :
1.6 + * ===============================================================
1.7 + * CS:S DM, Copyright (C) 2004-2007 AlliedModders LLC.
1.8 + * By David "BAILOPAN" Anderson
1.9 + * All rights reserved.
1.10 + * ===============================================================
1.11 + *
1.12 + * This program is free software; you can redistribute it and/or modify
1.13 + * it under the terms of the GNU General Public License as published by
1.14 + * the Free Software Foundation; either version 2 of the License, or (at
1.15 + * your option) any later version.
1.16 + *
1.17 + * This program is distributed in the hope that it will be useful, but
1.18 + * WITHOUT ANY WARRANTY; without even the implied warranty of
1.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.20 + * General Public License for more details.
1.21 + *
1.22 + * You should have received a copy of the GNU General Public License
1.23 + * along with this program; see the file COPYING; if not, write to the
1.24 + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
1.25 + * MA 02110-1301 USA
1.26 + *
1.27 + * Version: $Id$
1.28 + */
1.29 +
1.30 +#ifndef _INCLUDE_CSSDM_UTILS_H_
1.31 +#define _INCLUDE_CSSDM_UTILS_H_
1.32 +
1.33 +#include "smsdk_ext.h"
1.34 +
1.35 +#if defined PLATFORM_LINUX
1.36 +#define EXTRA_VTBL_OFFSET 1
1.37 +#elif defined PLATFORM_WINDOWS
1.38 +#define EXTRA_VTBL_OFFSET 0
1.39 +#endif
1.40 +
1.41 +#define CS_TEAM_T 2
1.42 +#define CS_TEAM_CT 3
1.43 +
1.44 +struct dmpatch_t
1.45 +{
1.46 + unsigned char patch[20];
1.47 + size_t bytes;
1.48 +};
1.49 +
1.50 +/** "Safe" functions */
1.51 +CBaseEntity *DM_GetBaseEntity(int index);
1.52 +void DM_RespawnPlayer(int client);
1.53 +void DM_RemoveEntity(CBaseEntity *pEntity);
1.54 +bool DM_IsPlayerAlive(int client);
1.55 +bool DM_CheckSerial(edict_t *pEdict, int serial);
1.56 +size_t DM_StringToBytes(const char *str, unsigned char buffer[], size_t maxlength);
1.57 +void DM_ApplyPatch(void *address, int offset, const dmpatch_t *patch, dmpatch_t *restore);
1.58 +CBaseEntity *DM_GetWeaponFromSlot(CBaseEntity *pEntity, int slot);
1.59 +void DM_DropWeapon(CBaseEntity *pEntity, CBaseEntity *pWeapon);
1.60 +void DM_RemoveAllItems(CBaseEntity *pEntity, bool removeSuit);
1.61 +void DM_SetMemPatchable(void *address, size_t size);
1.62 +void DM_SetDefuseKit(CBaseEntity *pEntity, bool defuseKit);
1.63 +int DM_GiveAmmo(CBaseEntity *pEntity, int type, int count, bool noSound);
1.64 +
1.65 +/** "Internal" functions */
1.66 +CBaseEntity *DM_GetAndClearRagdoll(CBaseEntity *pEntity, int &serial);
1.67 +
1.68 +/** Main functions */
1.69 +bool InitializeUtils(char *error, size_t maxlength);
1.70 +void ShutdownUtils();
1.71 +
1.72 +#endif //_INCLUDE_CSSDM_UTILS_H_