Skip to content

Commit 5abe1e6

Browse files
authored
Merge branch 'master' into fix/client-side-entity
2 parents 74cbc2b + 1307ddd commit 5abe1e6

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2721,6 +2721,7 @@ void CClientGame::AddBuiltInEvents()
27212721
m_Events.AddEvent("onClientPlayerRadioSwitch", "", NULL, false);
27222722
m_Events.AddEvent("onClientPlayerDamage", "attacker, weapon, bodypart", NULL, false);
27232723
m_Events.AddEvent("onClientPlayerWeaponFire", "weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement", NULL, false);
2724+
m_Events.AddEvent("onClientPlayerWeaponReload", "weapon, clip, ammo", nullptr, false);
27242725
m_Events.AddEvent("onClientPlayerWasted", "ammo, killer, weapon, bodypart, isStealth, animGroup, animID", nullptr, false);
27252726
m_Events.AddEvent("onClientPlayerChoke", "", NULL, false);
27262727
m_Events.AddEvent("onClientPlayerVoiceStart", "", NULL, false);
@@ -2739,6 +2740,7 @@ void CClientGame::AddBuiltInEvents()
27392740
m_Events.AddEvent("onClientPedVehicleEnter", "vehicle, seat", NULL, false);
27402741
m_Events.AddEvent("onClientPedVehicleExit", "vehicle, seat", NULL, false);
27412742
m_Events.AddEvent("onClientPedWeaponFire", "weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement", NULL, false);
2743+
m_Events.AddEvent("onClientPedWeaponReload", "weapon, clip, ammo", nullptr, false);
27422744
m_Events.AddEvent("onClientPedWasted", "", NULL, false);
27432745
m_Events.AddEvent("onClientPedChoke", "", NULL, false);
27442746
m_Events.AddEvent("onClientPedHeliKilled", "heli", NULL, false);

Client/mods/deathmatch/logic/CClientPed.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6119,6 +6119,21 @@ bool CClientPed::ReloadWeapon() noexcept
61196119
if (!CanReloadWeapon() || (task && task->GetTaskType() == TASK_SIMPLE_USE_GUN))
61206120
return false;
61216121

6122+
CLuaArguments args;
6123+
args.PushNumber(weapon->GetType());
6124+
args.PushNumber(weapon->GetAmmoInClip());
6125+
args.PushNumber(weapon->GetAmmoTotal());
6126+
6127+
bool result = false;
6128+
6129+
if (IS_PLAYER(this))
6130+
result = CallEvent("onClientPlayerWeaponReload", args, true);
6131+
else
6132+
result = CallEvent("onClientPedWeaponReload", args, true);
6133+
6134+
if (!result)
6135+
return false;
6136+
61226137
weapon->SetState(WEAPONSTATE_RELOADING);
61236138
return true;
61246139
}

Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: MTA San Andreas 1.x\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-08-12 20:34+0000\n"
11+
"POT-Creation-Date: 2025-08-21 03:00+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -732,23 +732,23 @@ msgstr ""
732732
msgid "MTA Client verification failed!"
733733
msgstr ""
734734

735-
#: Client/mods/deathmatch/logic/CClientGame.cpp:5644
735+
#: Client/mods/deathmatch/logic/CClientGame.cpp:5646
736736
msgid "In a ditch"
737737
msgstr ""
738738

739-
#: Client/mods/deathmatch/logic/CClientGame.cpp:5644
739+
#: Client/mods/deathmatch/logic/CClientGame.cpp:5646
740740
msgid "En-route to hospital"
741741
msgstr ""
742742

743-
#: Client/mods/deathmatch/logic/CClientGame.cpp:5644
743+
#: Client/mods/deathmatch/logic/CClientGame.cpp:5646
744744
msgid "Meeting their maker"
745745
msgstr ""
746746

747-
#: Client/mods/deathmatch/logic/CClientGame.cpp:5645
747+
#: Client/mods/deathmatch/logic/CClientGame.cpp:5647
748748
msgid "Regretting their decisions"
749749
msgstr ""
750750

751-
#: Client/mods/deathmatch/logic/CClientGame.cpp:5645
751+
#: Client/mods/deathmatch/logic/CClientGame.cpp:5647
752752
msgid "Wasted"
753753
msgstr ""
754754

0 commit comments

Comments
 (0)