cssdm_utils.h
author Ruben Gonzalez <drifter01620@gmail.com>
Wed Oct 01 11:50:24 2014 -0400 (2014-10-01)
changeset 193 277c856152b0
parent 7 1107793f4b1c
permissions -rw-r--r--
Update linix CS:GO gamedata
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * CS:S DM, Copyright (C) 2004-2007 AlliedModders LLC. 
     5  * By David "BAILOPAN" Anderson
     6  * All rights reserved.
     7  * ===============================================================
     8  *
     9  * This program is free software; you can redistribute it and/or modify
    10  * it under the terms of the GNU General Public License as published by
    11  * the Free Software Foundation; either version 2 of the License, or (at
    12  * your option) any later version.
    13  * 
    14  * This program is distributed in the hope that it will be useful, but
    15  * WITHOUT ANY WARRANTY; without even the implied warranty of
    16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    17  * General Public License for more details.
    18  * 
    19  * You should have received a copy of the GNU General Public License
    20  * along with this program; see the file COPYING; if not, write to the
    21  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
    22  * MA 02110-1301 USA
    23  * 
    24  * Version: $Id$
    25  */
    26 
    27 #ifndef _INCLUDE_CSSDM_UTILS_H_
    28 #define _INCLUDE_CSSDM_UTILS_H_
    29 
    30 #include "smsdk_ext.h"
    31 
    32 #if defined PLATFORM_POSIX
    33 #define EXTRA_VTBL_OFFSET	1
    34 #elif defined PLATFORM_WINDOWS
    35 #define EXTRA_VTBL_OFFSET	0
    36 #endif
    37 
    38 #define CS_TEAM_T		2
    39 #define CS_TEAM_CT		3
    40 
    41 struct dmpatch_t
    42 {
    43 	dmpatch_t()
    44 	{
    45 		patch[0] = 0;
    46 		bytes = 0;
    47 	}
    48 	unsigned char patch[20];
    49 	size_t bytes;
    50 };
    51 
    52 /** "Safe" functions */
    53 CBaseEntity *DM_GetBaseEntity(int index);
    54 void DM_RespawnPlayer(int client);
    55 void DM_RemoveEntity(CBaseEntity *pEntity);
    56 bool DM_IsPlayerAlive(int client);
    57 bool DM_CheckSerial(edict_t *pEdict, int serial);
    58 size_t DM_StringToBytes(const char *str, unsigned char buffer[], size_t maxlength);
    59 void DM_ApplyPatch(void *address, int offset, const dmpatch_t *patch, dmpatch_t *restore);
    60 CBaseEntity *DM_GetWeaponFromSlot(CBaseEntity *pEntity, int slot);
    61 void DM_DropWeapon(CBaseEntity *pEntity, CBaseEntity *pWeapon);
    62 void DM_RemoveAllItems(CBaseEntity *pEntity, bool removeSuit);
    63 void DM_SetMemPatchable(void *address, size_t size);
    64 void DM_SetDefuseKit(CBaseEntity *pEntity, bool defuseKit);
    65 int DM_GiveAmmo(CBaseEntity *pEntity, int type, int count, bool noSound);
    66 
    67 /** "Internal" functions */
    68 CBaseEntity *DM_GetAndClearRagdoll(CBaseEntity *pEntity, int &serial);
    69 
    70 /** Main functions */
    71 bool InitializeUtils(char *error, size_t maxlength);
    72 void ShutdownUtils();
    73 
    74 #endif //_INCLUDE_CSSDM_UTILS_H_