-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathweaponmodels.inc
More file actions
82 lines (75 loc) · 2.91 KB
/
weaponmodels.inc
File metadata and controls
82 lines (75 loc) · 2.91 KB
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
/**
* =============================================================================
* Custom Weapon Models
*
* Copyright (C) 2015 Andersso
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#if defined _weaponmodels_included
#endinput
#endif
#define _weaponmodels_included
typeset WeaponModelsFunc
{
function bool (int weaponIndex, int client, int weapon, const char[] className);
function bool (int weaponIndex, int client, int weapon, const char[] className, int itemDefIndex);
};
public SharedPlugin __pl_weaponmodels =
{
name = "weaponmodels",
file = "weaponmodels.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};
public void __pl_weaponmodels_SetNTVOptional()
{
MarkNativeAsOptional("WeaponModels_AddWeaponByClassName");
MarkNativeAsOptional("WeaponModels_AddWeaponByItemDefIndex");
MarkNativeAsOptional("WeaponModels_RemoveWeaponModel");
}
/**
* @brief Adds a weapon model
*
* @param className Class name of the weapon to add.
* @param viewModel Model path of the view model, or NULL_STRING for no change.
* @param worldModel Model path of the world model, or NULL_STRING for no change.
* @param function Function to call when weapon is selected.
* @return The custom weapon model index, -1 on failure.
* @error Maximum amount of custom weapons has been reached.
*/
native void WeaponModels_AddWeaponByClassName(const char[] className, const char[] viewModel, const char[] worldModel, WeaponModelsFunc _function);
/**
* @brief Adds a weapon model
*
* @param itemDefIndex item definition index of the weapon to add.
* @param viewModel Model path of the view model, or NULL_STRING for no change.
* @param worldModel Model path of the world model, or NULL_STRING for no change.
* @param function Function to call when weapon is selected.
* @return The custom weapon model index, -1 on failure.
* @error Maximum amount of custom weapons has been reached.
*/
native void WeaponModels_AddWeaponByItemDefIndex(int itemDefIndex, const char[] viewModel, const char[] worldModel, WeaponModelsFunc _function);
/**
* @brief Removes a weapon model
*
* @param weaponIndex The weapon index returned from WeaponModels_AddWeaponBy...()
* @noreturn
* @error Weapon index is invalid
*/
native void WeaponModels_RemoveWeaponModel(int weaponIndex);