Jump to content
Korean Random
Sign in to follow this  
CyToTV

[0.9.18] Отлов события переключения типа снарядов

Recommended Posts

Помогите хукнуть функцию которая отвечает за переключения типа снарядов)

Share this post


Link to post

Short link
Share on other sites


def hookedOnCurrentShellChanged(intCD):
    ctrl = BigWorld.player().guiSessionProvider.shared.ammo
    if ctrl is not None:
        quantity, quantityInClip = ctrl.getCurrentShells()
    print intCD, quantity, quantityInClip


ammoCtrl = BigWorld.player().guiSessionProvider.shared.ammo
if ammoCtrl is not None:
    ammoCtrl.onCurrentShellChanged += hookedOnCurrentShellChanged

 

Edited by spoter
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites
def hookedOnCurrentShellChanged(intCD):
    ctrl = BigWorld.player().guiSessionProvider.shared.ammo
    if ctrl is not None:
        quantity, quantityInClip = ctrl.getCurrentShells()
    print intCD, quantity, quantityInClip


ammoCtrl = BigWorld.player().guiSessionProvider.shared.ammo
if ammoCtrl is not None:
    ammoCtrl.onCurrentShellChanged += hookedOnCurrentShellChanged

Большое спасибо! Ток самое важное то (для меня в данный момент) не работает. quantityInClip постоянно 0 выдает

 

'Кусок лога'

2017-05-24 21:07:02.066: INFO: intCD - 21002

2017-05-24 21:07:02.066: INFO: quantity - 29

2017-05-24 21:07:02.066: INFO: quantityInClip - 0

2017-05-24 21:07:12.770: INFO: intCD - 21514

2017-05-24 21:07:12.770: INFO: quantity - 21

2017-05-24 21:07:12.770: INFO: quantityInClip - 0

2017-05-24 21:07:36.224: INFO: intCD - 21002

2017-05-24 21:07:36.224: INFO: quantity - 29

2017-05-24 21:07:36.224: INFO: quantityInClip - 0

 

Share this post


Link to post

Short link
Share on other sites

на барабанщике пробуешь?

на тетрархе

я может просто не так понял) мне нужен id снаряда в панельке (допустим ББ - 1, ОФ - 2, Голда - 3)

Share this post


Link to post

Short link
Share on other sites

intCD вот тебе id

последний вопрос. а как по нему узнать тип снаряда?

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...