Parent Directory
|
Revision Log
Revision 1 - (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 : | } | ||
32 : | |||
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 : | /* Sets the model for a player */ | ||
57 : | native dod_set_model(id, const model[]); | ||
58 : | |||
59 : | /* Sets the model for a player */ | ||
60 : | native dod_set_body_number(id, bodynumber); | ||
61 : | |||
62 : | /* Un-Sets the model for a player */ | ||
63 : | native dod_clear_model(id); | ||
64 : | |||
65 : | /* Custom Weapon Support */ | ||
66 : | /* function will return index of new weapon */ | ||
67 : | native custom_weapon_add( const wpnname[], melee = 0, const logname[]="" ); | ||
68 : | |||
69 : | /* Function will pass damage done by this custom weapon to stats module and other plugins */ | ||
70 : | native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 ); | ||
71 : | |||
72 : | /* Function will pass info about custom weapon shot to stats module */ | ||
73 : | native custom_weapon_shot( weapon, index ); // weapon id , player id | ||
74 : | |||
75 : | /* function will return 1 if true */ | ||
76 : | native xmod_is_melee_wpn(wpnindex); | ||
77 : | |||
78 : | /* Returns weapon name. */ | ||
79 : | native xmod_get_wpnname(wpnindex, name[], len); | ||
80 : | |||
81 : | /* Returns weapon logname. */ | ||
82 : | native xmod_get_wpnlogname(wpnindex, name[], len); | ||
83 : | |||
84 : | /* Returns weapons array size */ | ||
85 : | native xmod_get_maxweapons(); | ||
86 : | |||
87 : | /* Returns stats array size ex. 8 in TS , 9 in DoD */ | ||
88 : | native xmod_get_stats_size(); | ||
89 : | |||
90 : | /* Returns 1 if true */ | ||
91 : | native xmod_is_custom_wpn(wpnindex); | ||
92 : | |||
93 : | /************* Shared Natives End ********************************/ | ||
94 : | |||
95 : | /* weapon logname to weapon name convertion */ | ||
96 : | native dod_wpnlog_to_name(const logname[],name[],len); | ||
97 : | |||
98 : | /* weapon logname to weapon index convertion */ | ||
99 : | native dod_wpnlog_to_id(const logname[]); | ||
100 : | |||
101 : | native dod_get_map_info( info ); | ||
102 : | |||
103 : | /* Returns id of currently carried weapon. Gets also | ||
104 : | * ammount of ammo in clip and backpack. */ | ||
105 : | native dod_get_user_weapon(index,&clip,&ammo); | ||
106 : | |||
107 : | /* Returns team score */ | ||
108 : | native dod_get_team_score(teamId); | ||
109 : | |||
110 : | /* Returns player class id */ | ||
111 : | native dod_get_user_class(index); | ||
112 : | |||
113 : | /* Returns player score */ | ||
114 : | native dod_get_user_score(index); | ||
115 : | |||
116 : | /* values are: 0-no prone, 1-prone, 2-prone + w_deploy */ | ||
117 : | native dod_get_pronestate(index); | ||
118 : | |||
119 : | /* It is not as safe as original but player deaths will not be increased */ | ||
120 : | native dod_user_kill(index); |
Contact | ViewVC Help |
Powered by ViewVC 1.0.4 |