Implemented request amb242: added cs_get/set_user_hostagekills() natives

This commit is contained in:
Scott Ehlert 2007-05-01 21:38:39 +00:00
parent fdb094045e
commit e34120803d
4 changed files with 41 additions and 2 deletions

View File

@ -1575,6 +1575,35 @@ static cell AMX_NATIVE_CALL cs_set_user_lastactivity(AMX *amx, cell *params)
return 1;
}
static cell AMX_NATIVE_CALL cs_get_user_hostagekills(AMX *amx, cell *params)
{
//Return number of hostages that user has killed
//Check player
CHECK_PLAYER(params[1]);
// Make into edict pointer
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
return *((int *)pPlayer->pvPrivateData + OFFSET_HOSTAGEKILLS);
}
static cell AMX_NATIVE_CALL cs_set_user_hostagekills(AMX *amx, cell *params)
{
//Set number of hostages that user has killed
//Check player
CHECK_PLAYER(params[1]);
// Make into edict pointer
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
*((int *)pPlayer->pvPrivateData + OFFSET_HOSTAGEKILLS) = params[2];
return 1;
}
static cell AMX_NATIVE_CALL cs_get_hostage_lastuse(AMX *amx, cell *params)
{
//Return time that the hostage was last used
@ -1689,6 +1718,8 @@ static cell AMX_NATIVE_CALL not_on_64(AMX* amx, cell* params)
}
#define cs_get_user_lastactivity not_on_64
#define cs_set_user_lastactivity not_on_64
#define cs_get_user_hostagekills not_on_64
#define cs_set_user_hostagekills not_on_64
#define cs_get_hostage_lastuse not_on_64
#define cs_set_hostage_lastuse not_on_64
#define cs_get_hostage_nextuse not_on_64
@ -1749,6 +1780,8 @@ AMX_NATIVE_INFO cstrike_Exports[] = {
{"cs_set_user_submodel", cs_set_user_submodel},
{"cs_get_user_lastactivity", cs_get_user_lastactivity},
{"cs_set_user_lastactivity", cs_set_user_lastactivity},
{"cs_get_user_hostagekills", cs_get_user_hostagekills},
{"cs_set_user_hostagekills", cs_set_user_hostagekills},
{"cs_get_hostage_lastuse", cs_get_hostage_lastuse},
{"cs_set_hostage_lastuse", cs_set_hostage_lastuse},
{"cs_get_hostage_nextuse", cs_get_hostage_nextuse},
@ -1756,7 +1789,6 @@ AMX_NATIVE_INFO cstrike_Exports[] = {
{"cs_get_c4_explode_time", cs_get_c4_explode_time},
{"cs_set_c4_explode_time", cs_set_c4_explode_time},
//------------------- <-- max 19 characters!
{NULL, NULL}
};

View File

@ -75,6 +75,7 @@
#define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET
#define OFFSET_VIP 209 + EXTRAOFFSET
#define OFFSET_TK 216 + EXTRAOFFSET // 040926
#define OFFSET_HOSTAGEKILLS 217 + EXTRAOFFSET
#define OFFSET_MAPZONE 235 + EXTRAOFFSET
#define OFFSET_ISDRIVING 350 + EXTRAOFFSET // 040926
#define OFFSET_STATIONARY 362 + EXTRAOFFSET // 040927 (363 works also!)

View File

@ -192,7 +192,7 @@
Name="Pawn Includes"
Filter="">
<File
RelativePath="..\..\..\plugins\include\cstrike.inc">
RelativePath="..\..\..\..\plugins\include\cstrike.inc">
</File>
</Filter>
</Files>

View File

@ -314,6 +314,12 @@ native Float:cs_get_user_lastactivity(index);
native cs_set_user_lastactivity(index, Float:value);
/* Gets or sets the number of hostages that a user has killed.
*/
native cs_get_user_hostagekills(index);
native cs_set_user_hostagekills(index, value);
/* Gets or sets the time that the hostage was last used.
*/
native Float:cs_get_hostage_lastuse(index);