AMXX-BG.INFO zp50_class_human.inc Raw include

zp50_class_human.inc

Original include source with line numbers.

Back Download .inc
1 #if defined _zp50_class_human_included
2 #endinput
3 #endif
4 #define _zp50_class_human_included
5
6 #include <zp50_core>
7 #include <zp50_class_human_const>
8
9 #if AMXX_VERSION_NUM >= 175
10 #pragma reqlib zp50_class_human
11 #if !defined AMXMODX_NOAUTOLOAD
12 #pragma loadlib zp50_class_human
13 #endif
14 #else
15 #pragma library zp50_class_human
16 #endif
17
18
19 /**
20 * Returns a player's current human class ID.
21 *
22 * @param id Player index.
23 * @return Internal human class ID, or ZP_INVALID_HUMAN_CLASS if not yet chosen.
24 */
25 native zp_class_human_get_current(id)
26
27 /**
28 * Returns a player's next human class ID (for the next infection).
29 *
30 * @param id Player index.
31 * @return Internal human class ID, or ZP_INVALID_HUMAN_CLASS if not yet chosen.
32 */
33 native zp_class_human_get_next(id)
34
35 /**
36 * Sets a player's next human class ID (for the next infection).
37 *
38 * @param id Player index.
39 * @param classid A valid human class ID.
40 * @return True on success, false otherwise.
41 */
42 native zp_class_human_set_next(id, classid)
43
44 /**
45 * Registers a custom class which will be added to the human classes menu of ZP.
46 *
47 * Note: The returned human class ID can be later used to identify
48 * the class when calling the zp_get_user_human_class() natives.
49 *
50 * @param name Caption to display on the menu.
51 * @param description Brief description of the class.
52 * @param health Class health.
53 * @param speed Class maxspeed (can be a multiplier).
54 * @param gravity Class gravity multiplier.
55 * @return An internal human class ID, or ZP_INVALID_HUMAN_CLASS on failure.
56 */
57 native zp_class_human_register(const name[], const description[], health, Float:speed, Float:gravity)
58
59 /**
60 * Registers a custom player model for a given human class.
61 *
62 * @param classid A valid human class ID.
63 * @param model Player model's short name.
64 * @return True on success, false otherwise.
65 */
66 native zp_class_human_register_model(classid, const model[])
67
68 /**
69 * Returns a human class' ID.
70 *
71 * @param name Class name to look for.
72 * @return Internal human class ID, or ZP_INVALID_HUMAN_CLASS if not found.
73 */
74 native zp_class_human_get_id(const real_name[])
75
76 /**
77 * Returns a human class' name.
78 *
79 * @param classid A valid human class ID.
80 * @param name The buffer to store the string in.
81 * @param len Character size of the output buffer.
82 * @return True on success, false otherwise.
83 */
84 native zp_class_human_get_name(classid, name[], len)
85
86 /**
87 * Returns a human class' real name (used when registering the class).
88 *
89 * @param classid A valid human class ID.
90 * @param name The buffer to store the string in.
91 * @param len Character size of the output buffer.
92 * @return True on success, false otherwise.
93 */
94 native zp_class_human_get_real_name(classid, real_name[], len)
95
96 /**
97 * Returns a human class' description.
98 *
99 * @param classid A valid human class ID.
100 * @param description The buffer to store the string in.
101 * @param len Character size of the output buffer.
102 * @return True on success, false otherwise.
103 */
104 native zp_class_human_get_desc(classid, description[], len)
105
106 /**
107 * Returns number of registered human classes.
108 *
109 * @return Human class count.
110 */
111 native zp_class_human_get_count()
112
113 /**
114 * Shows menu with available human classes to a player.
115 *
116 * @param id Player index.
117 */
118 native zp_class_human_show_menu(id)
119
120 /**
121 * Appends text to a class being displayed on the human classes menu.
122 * Use this on the class select pre forward.
123 *
124 * @param text Additional text to display.
125 */
126 native zp_class_human_menu_text_add(const text[])
127
128 /**
129 * Called when determining whether a class should be available to a player.
130 *
131 * Possible return values are:
132 * - ZP_CLASS_AVAILABLE (show in menu, allow selection)
133 * - ZP_CLASS_NOT_AVAILABLE (show in menu, don't allow selection)
134 * - ZP_CLASS_DONT_SHOW (don't show in menu, don't allow selection)
135 *
136 * @param id Player index.
137 * @param classid Internal human class ID.
138 */
139 forward zp_fw_class_human_select_pre(id, classid)
140