|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0009635||New issues||Scripting||public||2017-05-14 17:14||2017-05-16 11:39|
|Summary||0009635: [Request] onClientPlayerWeaponPreFire + cancel ability|
|Description||It would be nice to be able to prevent the player from shooting by using cancelEvent(). Using this server side will still let the player shoot, however the shot doesnt get synced. A better solution would be to not let the player shoot at all by cancelling it on the client.|
Also current behaviour when pressing "fire" while using the camera results in GTA taking a screenshot that gets saved to the GTA San Andreas User files. onClientPlayerWeaponFire does trigger there too, and cancelling it should prevent the game from taking that screenshot.
|Additional Information||On my server there are situations where it is better to prevent the player from shooting if many certain conditions meet together. Using toggleControl() is very unpractical to use in some these situations, cancelEvent() however would allow to prevent single shots without actually disabling said control.|
|Tags||No tags attached.|
toggleControl ( "fire", false ) -- or true :D i dont know
Using toggleControl would mean that i have to use onClientRender() to check if the player is allowed to shoot or not and enable/disable the control there each frame.
Plus sometimes i need the client to actually fire the weapon and then check the parameters in onClientPlayerWeaponFire to check if the shot is valid and THEN cancel it afterwards (if thats possible)
Agree, except it should be only cancel able for the localPlayer.(security)
It's not possible to cancel server side onPlayerWeaponFire because bullets are synced on a separate thread. onClientPlayerWeaponFire is triggered too late to be cancelled.
The only alternative would be to add a new event like onClientPlayerWeaponPreFire
@IIYAMA12 yes of course only cancellable for the localPlayer.
@ccw then maybe its better to rename this bug report summary when its impossible to resolve in its current form.
|2017-05-14 17:14||einheit-101||New Issue|
|2017-05-14 20:13||CrosRoad95||Note Added: 0025946|
|2017-05-14 22:09||einheit-101||Note Added: 0025948|
|2017-05-15 15:47||IIYAMA12||Note Added: 0025949|
|2017-05-15 19:01||ccw||Note Added: 0025950|
|2017-05-15 23:12||einheit-101||Note Added: 0025951|
|2017-05-16 11:39||arranTuna||Summary||[Request] Ability to cancelEvent() with onClient(Player)WeaponFire => [Request] onClientPlayerWeaponPreFire + cancel ability|
|Copyright © 2000 - 2017 MantisBT Team|