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