amxmodx/plugins/include/tsx.inc

89 lines
2.5 KiB
SourcePawn
Raw Normal View History

// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// https://alliedmods.net/amxmodx-license
//
// TSX Functions
//
2004-09-10 07:12:38 +04:00
#if defined _tsx_included
#endinput
2004-09-10 07:12:38 +04:00
#endif
#define _tsx_included
#include <tsstats>
#pragma reqclass xstats
#if !defined AMXMODX_NOAUTOLOAD
#pragma defclasslib xstats tsx
2006-05-10 14:42:49 +04:00
#endif
2005-07-15 23:05:31 +04:00
2004-09-10 07:12:38 +04:00
/************* Shared Natives Start ********************************/
/* Forward types */
enum {
XMF_DAMAGE = 0,
XMF_DEATH,
};
2004-09-10 07:12:38 +04:00
2006-02-26 11:15:12 +03:00
/* Use this function to register forwards
* DEPRECATED
*/
2004-09-10 07:12:38 +04:00
native register_statsfwd( ftype );
/* Function is called after player to player attacks ,
* if players were damaged by teammate TA is set to 1 */
forward client_damage(attacker,victim,damage,wpnindex,hitplace,TA);
/* Function is called after player death ,
* if player was killed by teammate TK is set to 1 */
forward client_death(killer,victim,wpnindex,hitplace,TK);
/* Custom Weapon Support */
/* function will return index of new weapon */
native custom_weapon_add( const wpnname[],melee = 0,const logname[]="" );
2004-09-10 07:12:38 +04:00
/* Function will pass damage done by this custom weapon to stats module and other plugins */
native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 );
/* Function will pass info about custom weapon shot to stats module */
native custom_weapon_shot( weapon,index ); // weapon id , player id
/* function will return 1 if true */
native xmod_is_melee_wpn(wpnindex);
/* Returns weapon name. */
native xmod_get_wpnname(wpnindex,name[],len);
/* Returns weapon logname. */
native xmod_get_wpnlogname(wpnindex,name[],len);
/* Returns weapons array size */
native xmod_get_maxweapons();
/* Returns stats array size ex. 8 in TS , 9 in DoD */
native xmod_get_stats_size();
/* Returns 1 if true */
native xmod_is_custom_wpn(wpnindex);
2005-11-14 01:21:15 +03:00
/************* Shared Natives End ********************************/
/* Spawns a Weapon */
stock ts_weaponspawn(const weaponid[], const duration[], const extraclip[], const spawnflags[], const Float:Origin[3])
2005-11-14 01:21:15 +03:00
{
new ent = create_entity("ts_groundweapon");
DispatchKeyValue(ent, "tsweaponid", weaponid);
DispatchKeyValue(ent, "wduration", duration);
DispatchKeyValue(ent, "wextraclip", extraclip);
DispatchKeyValue(ent, "spawnflags", spawnflags);
DispatchSpawn(ent);
entity_set_origin(ent, Origin);
return PLUGIN_HANDLED;
}