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