crxknives.inc
Original include source with line numbers.
| 1 | #if defined _crxknives_included |
| 2 | #endinput |
| 3 | #endif |
| 4 | |
| 5 | #define _crxknives_included |
| 6 | |
| 7 | #if !defined _crxknives_const_included |
| 8 | #include <crxknives_const> |
| 9 | #endif |
| 10 | |
| 11 | /** |
| 12 | * Called when the client's knife model is changed. |
| 13 | * |
| 14 | * @param id Client index |
| 15 | * @param knife Knife index |
| 16 | * @param onconnect True if this was called when the client first joined, false otherwise |
| 17 | * @noreturn |
| 18 | */ |
| 19 | forward crxknives_knife_updated(id, knife, bool:onconnect) |
| 20 | |
| 21 | /** |
| 22 | * Called when the client attempts to change his knife model. |
| 23 | * |
| 24 | * @param id Client index |
| 25 | * @param knife Knife index |
| 26 | * @return PLUGIN_HANDLED to prevent the client from changing his knife, |
| 27 | * PLUGIN_CONTINUE to allow the change |
| 28 | */ |
| 29 | forward crxknives_attempt_change(id, knife) |
| 30 | |
| 31 | /** |
| 32 | * Checks whether or not the client can use a knife skill according to the cvar "km_knife_only_skills" |
| 33 | * |
| 34 | * @param id Client index |
| 35 | * @return True if he can, false otherwise |
| 36 | */ |
| 37 | native bool:crxknives_can_use_skill(id) |
| 38 | |
| 39 | /** |
| 40 | * Returns the integer value from a knife attribute. |
| 41 | * |
| 42 | * @param id Client index |
| 43 | * @param attribute Knife attribute |
| 44 | * @param dest Integer variable to store the value in |
| 45 | * @param playerid If set to false, the "id" parameter will be treated as a knife index instead |
| 46 | * @return True if the client or knife has that attribute set, false otherwise |
| 47 | */ |
| 48 | native bool:crxknives_get_attribute_int(id, const attribute[], &dest, bool:playerid = true) |
| 49 | |
| 50 | /** |
| 51 | * Returns the float value from a knife attribute. |
| 52 | * |
| 53 | * @param id Client index |
| 54 | * @param attribute Knife attribute |
| 55 | * @param dest Float variable to store the value in |
| 56 | * @param playerid If set to false, the "id" parameter will be treated as a knife index instead |
| 57 | * @return True if the client or knife has that attribute set, false otherwise |
| 58 | */ |
| 59 | native bool:crxknives_get_attribute_float(id, const attribute[], &Float:dest, bool:playerid = true) |
| 60 | |
| 61 | /** |
| 62 | * Returns the string value from a knife attribute. |
| 63 | * |
| 64 | * @note You can also return the knife name by using the "NAME" attribute. |
| 65 | * |
| 66 | * @param id Client index |
| 67 | * @param attribute Knife attribute |
| 68 | * @param dest Buffer to store the value in |
| 69 | * @param len Max buffer length |
| 70 | * @param playerid If set to false, the "id" parameter will be treated as a knife index instead |
| 71 | * @return True if the client or knife has that attribute set, false otherwise |
| 72 | */ |
| 73 | native bool:crxknives_get_attribute_str(id, const attribute[], dest[], len, bool:playerid = true) |
| 74 | |
| 75 | /** |
| 76 | * Returns the total number of registered knives. |
| 77 | * |
| 78 | * @return Total number of registered knives |
| 79 | */ |
| 80 | native crxknives_get_knives_num() |
| 81 | |
| 82 | /** |
| 83 | * Gets the client's current knife. |
| 84 | * |
| 85 | * @param id Client index |
| 86 | * @return Client's knife index |
| 87 | */ |
| 88 | native crxknives_get_user_knife(id) |
| 89 | |
| 90 | /** |
| 91 | * Checks whether or not the client has access to the specified knife. |
| 92 | * |
| 93 | * @param id Client index |
| 94 | * @param knife Knife index |
| 95 | * @return True if he has, false otherwise |
| 96 | */ |
| 97 | native bool:crxknives_has_knife_access(id, knife) |
| 98 | |
| 99 | /** |
| 100 | * Checks whether or not the knife index is valid. |
| 101 | * |
| 102 | * @param knife Knife index |
| 103 | * @return True if it is, false otherwise |
| 104 | */ |
| 105 | native bool:crxknives_is_knife_valid(knife) |