Parent Directory | Revision Log
Revision 17 - (view) (download)
1 : | ian | 1 | /* TSXMod functions |
2 : | * | ||
3 : | * (c) 2004, SidLuke | ||
4 : | * This file is provided as is (no warranties). | ||
5 : | */ | ||
6 : | |||
7 : | #if defined _tsx_included | ||
8 : | #endinput | ||
9 : | #endif | ||
10 : | #define _tsx_included | ||
11 : | |||
12 : | #include <tsstats> | ||
13 : | |||
14 : | #if AMXX_VERSION_NUM >= 175 | ||
15 : | #pragma reqclass xstats | ||
16 : | #if !defined AMXMODX_NOAUTOLOAD | ||
17 : | #pragma defclasslib xstats tsx | ||
18 : | #endif | ||
19 : | #else | ||
20 : | #pragma library tsx | ||
21 : | #endif | ||
22 : | |||
23 : | /************* Shared Natives Start ********************************/ | ||
24 : | |||
25 : | /* Forward types */ | ||
26 : | enum { | ||
27 : | XMF_DAMAGE = 0, | ||
28 : | XMF_DEATH, | ||
29 : | ian | 17 | }; |
30 : | ian | 1 | |
31 : | /* Use this function to register forwards | ||
32 : | * DEPRECATED | ||
33 : | */ | ||
34 : | native register_statsfwd( ftype ); | ||
35 : | |||
36 : | /* Function is called after player to player attacks , | ||
37 : | * if players were damaged by teammate TA is set to 1 */ | ||
38 : | forward client_damage(attacker,victim,damage,wpnindex,hitplace,TA); | ||
39 : | |||
40 : | /* Function is called after player death , | ||
41 : | * if player was killed by teammate TK is set to 1 */ | ||
42 : | forward client_death(killer,victim,wpnindex,hitplace,TK); | ||
43 : | |||
44 : | /* Custom Weapon Support */ | ||
45 : | /* function will return index of new weapon */ | ||
46 : | native custom_weapon_add( const wpnname[],melee = 0,const logname[]="" ); | ||
47 : | /* Function will pass damage done by this custom weapon to stats module and other plugins */ | ||
48 : | native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 ); | ||
49 : | /* Function will pass info about custom weapon shot to stats module */ | ||
50 : | native custom_weapon_shot( weapon,index ); // weapon id , player id | ||
51 : | |||
52 : | /* function will return 1 if true */ | ||
53 : | native xmod_is_melee_wpn(wpnindex); | ||
54 : | |||
55 : | /* Returns weapon name. */ | ||
56 : | native xmod_get_wpnname(wpnindex,name[],len); | ||
57 : | |||
58 : | /* Returns weapon logname. */ | ||
59 : | native xmod_get_wpnlogname(wpnindex,name[],len); | ||
60 : | |||
61 : | /* Returns weapons array size */ | ||
62 : | native xmod_get_maxweapons(); | ||
63 : | |||
64 : | /* Returns stats array size ex. 8 in TS , 9 in DoD */ | ||
65 : | native xmod_get_stats_size(); | ||
66 : | |||
67 : | /* Returns 1 if true */ | ||
68 : | native xmod_is_custom_wpn(wpnindex); | ||
69 : | |||
70 : | /************* Shared Natives End ********************************/ | ||
71 : | |||
72 : | /* Spawns a Weapon */ | ||
73 : | stock ts_weaponspawn(const weaponid[], const duration[], const extraclip[], const spawnflags[], const Float:Origin[3]) | ||
74 : | { | ||
75 : | new ent = create_entity("ts_groundweapon"); | ||
76 : | |||
77 : | DispatchKeyValue(ent, "tsweaponid", weaponid); | ||
78 : | DispatchKeyValue(ent, "wduration", duration); | ||
79 : | DispatchKeyValue(ent, "wextraclip", extraclip); | ||
80 : | DispatchKeyValue(ent, "spawnflags", spawnflags); | ||
81 : | DispatchSpawn(ent); | ||
82 : | |||
83 : | entity_set_origin(ent, Origin); | ||
84 : | return PLUGIN_HANDLED; | ||
85 : | } |
Contact | ViewVC Help |
Powered by ViewVC 1.0.4 |