*** empty log message ***

This commit is contained in:
Johnny Bergström 2005-03-16 21:00:16 +00:00
parent 448da8bd9e
commit ad732d7286
2 changed files with 23 additions and 15 deletions

View File

@ -1200,6 +1200,23 @@ static cell AMX_NATIVE_CALL cs_get_user_stationary(AMX *amx, cell *params) // cs
#endif
}
static cell AMX_NATIVE_CALL cs_get_user_shield(AMX *amx, cell *params)
{
//Return 1 if user has a shield.
//params[1] = user id
//Check player
CHECK_PLAYER(params[1]);
// Make into edict pointer
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_SHIELD) & HAS_SHIELD)
return 1;
return 0;
}
AMX_NATIVE_INFO cstrike_Exports[] = {
{"cs_set_user_money", cs_set_user_money},
{"cs_get_user_money", cs_get_user_money},
@ -1240,6 +1257,7 @@ AMX_NATIVE_INFO cstrike_Exports[] = {
{"cs_get_user_stationary", cs_get_user_stationary},
{"cs_get_user_armor", cs_get_user_armor},
{"cs_set_user_armor", cs_set_user_armor},
{"cs_get_user_shield", cs_get_user_shield},
//------------------- <-- max 19 characters!
{NULL, NULL}
};
@ -1308,22 +1326,7 @@ void PlayerPostThink(edict_t* pPlayer) {
RETURN_META(MRES_IGNORED);
}
static cell AMX_NATIVE_CALL cs_user_has_shield(AMX *amx, cell *params)
{
//Return 1 if user has a shield.
//params[1] = user id
//Check player
CHECK_PLAYER(params[1]);
// Make into edict pointer
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_SHIELD) & HAS_SHIELD)
return 1;
return 0;
}
void OnAmxxAttach()
{

View File

@ -172,6 +172,10 @@ native cs_set_user_tked(index, tk = 1, subtract = 1);
*/
native cs_get_user_driving(index);
/* Returns 1 if user has a shield, else 0.
*/
native cs_get_user_shield(index);
/* Returns 1 if user is using a stationary gun, else 0.
*/
native cs_get_user_stationary(index);
@ -228,3 +232,4 @@ native cs_get_no_knives();
* You can still give knives (ie through fun's give_item).
*/
native cs_set_no_knives(noknives = 0);