View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009635New issuesScriptingpublic2017-05-14 17:142017-05-16 11:39
Assigned To 
PlatformOSOS Version
Summary0009635: [Request] onClientPlayerWeaponPreFire + cancel ability
DescriptionIt 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 InformationOn 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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
CrosRoad95 (viewer)
2017-05-14 20:13

use [^]
toggleControl ( "fire", false ) -- or true :D i dont know
einheit-101 (reporter)
2017-05-14 22:09

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)
IIYAMA12 (viewer)
2017-05-15 15:47

Agree, except it should be only cancel able for the localPlayer.(security)
ccw (administrator)
2017-05-15 19:01

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
einheit-101 (reporter)
2017-05-15 23:12

@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.

- Issue History
Date Modified Username Field Change
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
Powered by Mantis Bugtracker