[Half-Life AMXX] / include / dodx.inc Repository:
ViewVC logotype

Annotation of /include/dodx.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17 - (view) (download)

1 : ian 1 /* DoDX functions
2 :     *
3 :     * (c) 2004, SidLuke
4 :     * This file is provided as is (no warranties).
5 :     */
6 :    
7 :     #if defined _dodx_included
8 :     #endinput
9 :     #endif
10 :     #define _dodx_included
11 :    
12 :     #include <dodconst>
13 :     #include <dodstats>
14 :    
15 :     #if AMXX_VERSION_NUM >= 175
16 :     #pragma reqclass xstats
17 :     #if !defined AMXMODX_NOAUTOLOAD
18 :     #pragma defclasslib xstats dodx
19 :     #endif
20 :     #else
21 :     #pragma library dodx
22 :     #endif
23 :    
24 :     /************* Shared Natives Start ********************************/
25 :    
26 :     /* Forward types */
27 :     enum {
28 :     XMF_DAMAGE = 0,
29 :     XMF_DEATH,
30 :     XMF_SCORE,
31 : ian 17 };
32 : ian 1
33 :     /* Use this function to register forwards */
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 :     /* Function is called if player scored */
45 :     forward client_score(id, score, total);
46 :    
47 :     /* This Forward is called when a player changes team */
48 :     forward dod_client_changeteam(id, team, oldteam);
49 :    
50 :     /* This Forward is called if a player changes class, but just after spawn */
51 :     forward dod_client_changeclass(id, class, oldclass);
52 :    
53 :     /* This Forward is called when a player spawns */
54 :     forward dod_client_spawn(id);
55 :    
56 : ian 17 /* This will be called whenever a player scopes or unscopes
57 :     value = 1 scope up
58 :     value = 0 scope down */
59 :     forward dod_client_scope(id, value);
60 :    
61 :     /* This will be called whenever a player drops a weapon
62 :     weapon is weapon dropped or picked up
63 :     value = 1 picked up
64 :     value = 0 dropped */
65 :     forward dod_client_weaponpickup(id, weapon, value);
66 :    
67 :     /* Called whenever the the player goes to or comes from prone position
68 :     value = 1 going down
69 :     value = 0 getting up */
70 :     forward dod_client_prone(id, value);
71 :    
72 :     /* This will be called whenever a player switches a weapon */
73 :     forward dod_client_weaponswitch(id, wpnew, wpnold);
74 :    
75 :     /* Forward for when a grenade explodes and its location */
76 :     forward dod_grenade_explosion(id, pos[3], wpnid);
77 :    
78 :     /* Forward for when a rocket explodes and its location */
79 :     forward dod_rocket_explosion(id, pos[3], wpnid);
80 :    
81 :     /* Forward for when a player picks up a object */
82 :     forward dod_client_objectpickup(id, objid, pos[3], value);
83 :    
84 :     /* Forward for when a users stamina decreases */
85 :     forward dod_client_stamina(id, stamina);
86 :    
87 :     /* We want to get just the weapon of whichever type that the player is on him
88 :     Use DODWT_* in dodconst.inc for type */
89 :     native dod_weapon_type(id, type);
90 :    
91 :     /* This native will change the position of a weapon within the users slots and its ammo ammount */
92 :     native dod_set_weaponlist(id, wpnID, slot, dropslot, totalrds);
93 :    
94 : ian 1 /* Sets the model for a player */
95 :     native dod_set_model(id, const model[]);
96 :    
97 :     /* Sets the model for a player */
98 :     native dod_set_body_number(id, bodynumber);
99 :    
100 :     /* Un-Sets the model for a player */
101 :     native dod_clear_model(id);
102 :    
103 :     /* Custom Weapon Support */
104 :     /* function will return index of new weapon */
105 :     native custom_weapon_add( const wpnname[], melee = 0, const logname[]="" );
106 :    
107 :     /* Function will pass damage done by this custom weapon to stats module and other plugins */
108 :     native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 );
109 :    
110 :     /* Function will pass info about custom weapon shot to stats module */
111 :     native custom_weapon_shot( weapon, index ); // weapon id , player id
112 :    
113 :     /* function will return 1 if true */
114 :     native xmod_is_melee_wpn(wpnindex);
115 :    
116 :     /* Returns weapon name. */
117 :     native xmod_get_wpnname(wpnindex, name[], len);
118 :    
119 :     /* Returns weapon logname. */
120 :     native xmod_get_wpnlogname(wpnindex, name[], len);
121 :    
122 :     /* Returns weapons array size */
123 :     native xmod_get_maxweapons();
124 :    
125 :     /* Returns stats array size ex. 8 in TS , 9 in DoD */
126 :     native xmod_get_stats_size();
127 :    
128 :     /* Returns 1 if true */
129 :     native xmod_is_custom_wpn(wpnindex);
130 :    
131 :     /************* Shared Natives End ********************************/
132 :    
133 :     /* weapon logname to weapon name convertion */
134 :     native dod_wpnlog_to_name(const logname[],name[],len);
135 :    
136 :     /* weapon logname to weapon index convertion */
137 :     native dod_wpnlog_to_id(const logname[]);
138 :    
139 :     native dod_get_map_info( info );
140 :    
141 :     /* Returns id of currently carried weapon. Gets also
142 :     * ammount of ammo in clip and backpack. */
143 : ian 17 native dod_get_user_weapon(index,&clip=0,&ammo=0);
144 : ian 1
145 :     /* Returns team score */
146 :     native dod_get_team_score(teamId);
147 :    
148 :     /* Returns player class id */
149 :     native dod_get_user_class(index);
150 :    
151 :     /* Returns player score */
152 :     native dod_get_user_score(index);
153 :    
154 :     /* values are: 0-no prone, 1-prone, 2-prone + w_deploy */
155 :     native dod_get_pronestate(index);
156 :    
157 :     /* It is not as safe as original but player deaths will not be increased */
158 :     native dod_user_kill(index);

Contact
ViewVC Help
Powered by ViewVC 1.0.4