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