View Issue Details

IDProjectCategoryView StatusLast Update
0007747New Feature Requests[All Projects] Generalpublic2017-06-18 20:57
ReporterkakakskAssigned To 
Status newResolutionopen 
PlatformPCOSWindowsOS Version8
Summary0007747: [Request] Ablity to cancel onClient[Player/Ped]WeaponFire

Make "onClientPlayerWeaponFire" and "onClientPedWeaponFire" able to be cancelled, so the weapon can't fire, if cancelled.

TagsNo tags attached.



2013-08-04 12:46

viewer   ~~0019052

(16:28:35) <Tete|Laptop> Why onChatMessage isn't cancelable?
(16:30:32) <Tete|Laptop> Lets suppose i don't want to output any messages if the these messages were issued by some resource/player element
(16:31:26) <@Cazomino05> no
(16:31:29) <@Cazomino05> don't even go there
(16:31:34) <@Cazomino05> no events for scripting functions
(16:31:35) <@Cazomino05> just no
(16:33:37) <Tete|Laptop> What
(16:34:28) <@Cazomino05> I'm not explaining it
(16:34:33) <@Cazomino05> I can't be bothered just no



2013-08-04 13:03

manager   ~~0019054

toggleControl("fire", false) not good enough for you..?


2013-08-04 13:47

viewer   ~~0019056

Last edited: 2013-08-04 13:51

View 2 revisions

wall detection doesnt work with toggleControl as intended. Just random shooting mess. Toggling control on or off is too late, if its attached to the event. The weapon still fires.


2014-11-07 19:46

viewer   ~~0022266

Last edited: 2014-11-07 19:48

View 2 revisions

I support making onClientPedWeaponFire cancelable. Scripters currently can't cancel a shot according to how it was fired (it can only be canceled before by toggling the control, because during the event it has no effect). For example, we could use this to fancy stop players from shooting a car (and we wouldn't need to cancel onClientVehicleDamage event and give them the ammo back).


2014-11-07 20:26

manager   ~~0022267

Did you try disabling fire when they aim at the car, rather than when they shoot it?


2014-11-08 09:27

viewer   ~~0022273

Yes, I know that's possible with getPedTarget (or getPedTargetCollision, if you want to work with coordinates). Almost everything (everything?) is already possible with MTA. However, checking the results of that functions every frame using onClient[Pre/HUD]Render isn't so efficient as just cancelling the event if neccesary, so what I tried to say is that there's no fancy (simple and efficient) form of cancelling a shot during the event. Also, toggleControl is a function which, when used without caution, can interfere a lot with other scripts and annoy players, so I personally don't like using it much.


2014-11-08 12:49

manager   ~~0022274

onClientPlayerTarget wouldn't be inefficient.

Issue History

Date Modified Username Field Change