-
-
Notifications
You must be signed in to change notification settings - Fork 500
Server side weapon reloading #3936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Marek Kulik <[email protected]>
Co-authored-by: Marek Kulik <[email protected]>
|
Resolves #2747 |
|
I was just checking on a few things with peds when I saw this PR that an event called --server:
local ped = createPed(0, 0, 0, 3)
setElementID(ped, "ped")
addEventHandler("onPedWeaponReload", ped, function(weapon, clip, ammo) -- changing ped to root also not work
iprint("foo")
end)
--client:
local ped = getElementByID("ped")
givePedWeapon(ped, 22, 1000, true)
setPedControlState(ped, "aim_weapon", true)
setPedAimTarget(ped, 0, 10, 5)
setPedControlState(ped, "fire", true)
Version: Multi Theft Auto v1.7-untested-25351 EDIT* when calling |
Description
This pull request enhances the synchronization of weapon reloading for both peds and player with making it server sided. Refactors existing functions, introduces a new one, and adds two new events as well. Closes #1525.
Function
POP:
OOP:
Method:
ped:isReloadingWeapon()Variable
ped.reloadingWeaponEvents
Example
reloadtest.zip