cs_weapons_api.inc
Original include source with line numbers.
| 1 | #if defined _cswa_included |
| 2 | #endinput |
| 3 | #endif |
| 4 | #define _cswa_included |
| 5 | |
| 6 | #pragma semicolon 1 |
| 7 | |
| 8 | stock set_weapon_string(ent, type, array[]) entity_set_string(ent, type, array); |
| 9 | stock set_weapon_float(ent, type, Float:val) entity_set_float(ent, type, val); |
| 10 | stock set_weapon_integer(ent, type, val) entity_set_int(ent, type, val); |
| 11 | stock set_weapon_edict(ent, type, val) entity_set_edict(ent, type, val); |
| 12 | |
| 13 | stock get_weapon_string(ent, type, array[], size) entity_get_string(ent, type, array, size); |
| 14 | stock Float:get_weapon_float(ent, type) return entity_get_float(ent, type); |
| 15 | stock get_weapon_integer(ent, type) return entity_get_int(ent, type); |
| 16 | stock get_weapon_edict(ent, type) return entity_get_edict(ent, type); |
| 17 | |
| 18 | enum _:STOREABLE_REPLACEMENTS |
| 19 | { |
| 20 | REPL_CSWA_CLIP = EV_INT_iuser1, |
| 21 | REPL_CSWA_MAXCLIP = EV_INT_iuser2, |
| 22 | REPL_CSWA_AMMO = EV_INT_iuser3, |
| 23 | //EV_INT_iuser4, |
| 24 | |
| 25 | REPL_CSWA_SPEEDDELAY = EV_FL_fuser1, |
| 26 | REPL_CSWA_DAMAGE = EV_FL_fuser2, |
| 27 | REPL_CSWA_RELOADTIME = EV_FL_fuser3, |
| 28 | REPL_CSWA_RECOIL = EV_FL_fuser4, |
| 29 | |
| 30 | REPL_CSWA_STACKABLE = EV_ENT_euser1, |
| 31 | REPL_CSWA_SILENCED = EV_ENT_euser2, |
| 32 | REPL_CSWA_SET = EV_ENT_euser3, |
| 33 | REPL_CSWA_ITEMID = EV_ENT_euser4, |
| 34 | |
| 35 | //EV_SZ_noise, |
| 36 | REPL_CSWA_MODEL_V = EV_SZ_noise1, |
| 37 | REPL_CSWA_MODEL_P = EV_SZ_noise2, |
| 38 | REPL_CSWA_MODEL_W = EV_SZ_noise3 |
| 39 | } |
| 40 | |
| 41 | enum _:STOREABLE_STRUCTURE |
| 42 | { |
| 43 | STRUCT_CSWA_CSW, |
| 44 | STRUCT_CSWA_CLIP, |
| 45 | STRUCT_CSWA_MAXCLIP, |
| 46 | STRUCT_CSWA_AMMO, |
| 47 | STRUCT_CSWA_STACKABLE, |
| 48 | STRUCT_CSWA_SILENCED, |
| 49 | STRUCT_CSWA_SET, |
| 50 | STRUCT_CSWA_ITEMID, |
| 51 | Float:STRUCT_CSWA_SPEEDDELAY, |
| 52 | Float:STRUCT_CSWA_DAMAGE, |
| 53 | Float:STRUCT_CSWA_RELOADTIME, |
| 54 | Float:STRUCT_CSWA_RECOIL, |
| 55 | STRUCT_CSWA_MODEL_V[64], |
| 56 | STRUCT_CSWA_MODEL_P[64], |
| 57 | STRUCT_CSWA_MODEL_W[64] |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Gives player specific weapon. |
| 62 | * |
| 63 | * @param id Player index. |
| 64 | * @param array[] Array of STOREABLE_DATA enum. |
| 65 | * @param show Should show weapon? |
| 66 | * @return Weapon handle. |
| 67 | */ |
| 68 | native cswa_give_specific(id, array[], show = 0); |
| 69 | |
| 70 | /** |
| 71 | * Gives player normal weapon. |
| 72 | * |
| 73 | * @param id Player index. |
| 74 | * @param csw_id CSW_*. |
| 75 | * @param clip Clip. |
| 76 | * @param ammo Ammo. |
| 77 | * @param show Should show weapon? |
| 78 | * @return Weapon ENTID. |
| 79 | */ |
| 80 | native cswa_give_normal(id, csw_id, clip, ammo, show = 0); |
| 81 | |
| 82 | /** |
| 83 | * Called when someone is killed by special weapon. |
| 84 | * |
| 85 | * @param weapon_id Weapon handle. |
| 86 | * @param victim Killed player id. |
| 87 | * @param killer Killer player id. |
| 88 | */ |
| 89 | forward cswa_killed(weapon_id, victim, killer); |
| 90 | |
| 91 | /** |
| 92 | * Called when someone is shot at by special weapon. |
| 93 | * |
| 94 | * @param weapon_id Weapon handle. |
| 95 | * @param victim Killed player id. |
| 96 | * @param killer Killer player id. |
| 97 | */ |
| 98 | forward cswa_damage(weapon_id, victim, attacker, Float:damage); |