Commit Graph

1886 Commits

Author SHA1 Message Date
892f0519ad Adding flag parameter to user_silentkill.
The api says that the user_silentkill() "Kills a user without a message.",  that means it is just user_kill() without sending deathmsg.
But user_silentkill() automatically kills player without affecting the client's score (and that is not mentioned in api), so i'll add a second parameter to user_silnetkill() to let user to decide if he want to kill a player without or not affecting the table.
New parameter has the default value 1, so it won't break the compatibility.
2015-12-20 01:02:39 +02:00
a445e806ea Cstrike: Refactor - Simplify forwards logic, fix and improve few things
- The logic around CS_OnBuy forward has been simplified. Since there is no way to have a consistent way to hook/block for all items, the new logic is to have as less as possible code, especially in blocking mode where we want to avoid to do extra stuffs (e.g blocking sound, event, etc).

  * All guns + shield -> CanBuyThis()
  * Nvgs and Fefuser only -> CanPlayerBuy()
  * The others items -> GiveNamedItem() + AddAccount()
  * Ammos -> -> BuyGunAmmo() + GiveNamedItem() + AddAccount()

- Fixed missing buyzone check when alias from console are used (CS_OnBUy* were incorrectly fired).
- Fixed an infinite loop when buying of ammos are blocked. Sorted by hooking BuyGunAmmo().
- Fixed blocking mode for some items. Some game behaviors were not blocked (e.g. weapon drop).
- Fixed forwards being triggered even though errors were found. Detours are now a destroyed and associated variables resetted when necessary. Toggling forwards state is now based on detours state.
- Moved things in its own functions (game functions to execute, class members retrieval)
- Renamed CommandAliases -> ItemInfos (more generic)
2015-11-21 00:13:06 +01:00
e87976bc09 Cstrike: Remove CS_OnGetItemPrice forward (reverted from commit 33a7d74b6da2ca4dcb621e9b306c386ba040571e)
This is actually not possible to have a proper system to allow this.
This is two majors problems:
  - The item price text can't be changed, whatever old and VGUI menu (it's either harcoded in config file or in client binary)
  - Once you open VGUI menu, to know if user has enough money to select an item, client relies on the current HUD money value, this means, since we can't directly changed price, before opening the menu, money needs to be somehow faked and restored once closed. It's awful.

Overall it can't work properly, and at the end current forward doesn't make sense.

If an author wanted to have its own prices, the only only way would to force players to use old menu, then overwriting the whole buy menu, so you would be able to display what you want exactly.
2015-11-03 10:45:50 +01:00
ffe8b7761e Cstrike: Move CSW_* constants from amxconst.inc to cstrike_const.inc 2015-11-03 10:45:49 +01:00
2c5cc4289e Cstrike: Add cs_is_valid_itemid() stock 2015-11-03 10:45:49 +01:00
75853dae60 Cstrike: Add cs_find_ent_by_owner() native 2015-11-03 10:45:48 +01:00
23b0450938 Cstrike: Add cs_get_weapon_class() stock (weapon id -> class id)
Note: this has been modified a bit later in cs_is_valid_itemid() commit.
2015-11-03 10:45:47 +01:00
600a15a57b Cstrike: Add cs_get_weapon_info() native 2015-11-03 10:45:47 +01:00
60cdbeb219 Cstrike: Add CS_OnGetItemPrice forward to get/alter an item price on purchase 2015-11-03 10:45:46 +01:00
e6a2434887 Cstrike: Add cs_get_item_id() and cs_get_translated_item_alias() natives 2015-11-03 10:45:45 +01:00
c6628f22ee Cstrike: Add more known constants from game 2015-11-03 10:45:44 +01:00
d3e5957215 Cstrike: Add cstrike_const.inc and move existing constants there 2015-11-03 10:45:44 +01:00
dc6f171f20 Refactor 2 - Duplicate get_member_* for each set of natives for consistency 2015-11-02 20:10:38 +01:00
02c1b20ed7 Rename get_ent_data_size/info/basetype to be more generic 2015-11-02 20:10:37 +01:00
68f99bc2d5 Add get/Set_gamerules_* natives 2015-11-02 20:10:37 +01:00
16f65663dc Add new natives to read/write on entity's private data based off class/member name available from gamedata files 2015-09-19 20:07:48 +02:00
57a5004f4e Fix typo
Related to #266. Looks like I've changed the prefix afterward at some point for some reason, but engine is retarded and with `plugin.something.cfg` it will understand extension is `something` instead  of `cfg` ; and will fail to execute as it's an invalid extension (only `cfg` and `rc` are allowed).
2015-09-05 08:42:31 +02:00
224239f5a1 Merge pull request #266 from Arkshine/feature/autoexeccfg
Introduce automatic config file for plugins and two forwards
2015-08-26 10:42:59 +02:00
5b8bbddbc1 AutoExecConfig: Adjust few things 2015-08-26 10:38:31 +02:00
f95f2032fc Update cstrike.inc 2015-08-22 17:51:48 -03:00
1f3ba35140 AutoExecConfig: Remove config code in admin.sma 2015-08-14 16:38:28 +02:00
1f3c7cf272 AutoExecConfig: Update documentation 2015-08-14 16:38:28 +02:00
ed4faf7c11 Fix player not being internally disconnected in some situation + add client_disconnected forward 2015-08-14 00:08:50 +02:00
6d6a1c1ab0 Add a data argument in INI/SMC_ParseFile() to pass through to callbacks (bug 6228) 2015-07-29 22:23:13 +02:00
df5d935194 Add enable/disable_event() native 2015-07-20 23:06:32 +02:00
662fa61fc7 Cstrike: Fix typos and improve things 2015-07-15 16:40:07 +02:00
dcc2d91b14 Cstrike: cs_get_user_driving - Add the associated constants from HLSDK 2015-07-14 19:44:10 +02:00
86e33d0cb1 Cstrike: cs_set_user_model - Add a param to choose whether modelindex should be updated 2015-07-14 19:44:10 +02:00
1ed354890b Cstrike: Add CSI_SHIELD for convenience and fix typos 2015-07-14 19:44:08 +02:00
939aad5cb9 Cstrike: cs_set_user_team - Add a param to choose whether TeamInfo message should be sent 2015-07-14 19:44:08 +02:00
63a0910f5b Cstrike: cs_get/set_armoury_type - Add a param to get/set the number of weapons inside an armoury 2015-07-14 19:44:06 +02:00
81f9a23d16 Cstrike: cs_get_user_armor - Make optional armortype param 2015-07-14 19:44:06 +02:00
7842d0160b Cstrike: cs_set_weapon_silen - Add a new value for draw_animation to follow game behavior
- Player's model sequence will be properly played
- Disallow firing while animation is playing
2015-07-14 19:44:06 +02:00
87d740b92a Cstrike: Add CZ support for some hostage natives 2015-07-14 19:44:05 +02:00
b82588f081 Cstrike: cs_set_user_deaths - Add a param to choose whether scoreboard should be updated 2015-07-14 19:44:04 +02:00
139a2a082c Merge pull request #254 from Arkshine/feature/gameconfig
Implement a game config parser and expose functionnalities to the module/plugin API
2015-07-11 13:19:09 +02:00
f38c726faf Gameconfig: Add game configs natives 2015-07-11 13:16:45 +02:00
e98ab37806 fix memory leaks 2015-07-11 00:39:34 +03:00
846238fe99 Merge pull request #250 from Nextra/enginew
Engine Update
2015-07-02 18:43:35 +02:00
391991bfce https://bugs.alliedmods.net/show_bug.cgi?id=6372 bugfix 2015-06-15 18:54:29 +03:00
b364506cbc Merge pull request #241 from luxxxoor/patch-2
Update cmdmenu.sma
2015-05-17 20:10:22 +02:00
b77c8e253b Update cmdmenu.sma
Changed format with formatex where needed, removed many hardcoded contents in plugin and added semicolons.
2015-05-17 19:50:42 +03:00
679714c8be Engine: Add error path for remove_entity() and unsafe entity ids 2015-05-11 16:15:43 +02:00
ff0ca9ba67 Engine: Remove inconsistent error path from entity_get_int() 2015-05-11 16:15:42 +02:00
ee0bcc39f1 Engine: Clarify difference between the engine module trace handle and the "real" global trace 2015-05-11 16:15:42 +02:00
3c1022af99 Engine: Add a destination parameter to trace_hull() to make it more useful 2015-05-11 16:15:42 +02:00
add4867d21 Engine: Add safe get_global_edict2() and entity_get_edict2() 2015-05-10 23:56:06 +02:00
d69fddf8b4 Engine/Core: Move precache_event() to core 2015-05-10 23:45:01 +02:00
218fb9c794 Engine: Add unregister_[touch|think|impulse]() 2015-05-10 23:40:22 +02:00
c5f6e26802 Merge pull request #239 from Nextra/inc-doc3
Update include documentation #3 (mostly engine.inc)
2015-05-10 17:12:50 +02:00