BeforeOnPlayerShoot
#1

Holla everyone,

I've going through all the includes. I found an include for my usage: OnPlayerShoot(playerid)

I been learning the ALS/Hook methods to learn how to code myself callbacks which i can call them via CallLocalfunction!

So what exacty i want is: A callback which is called just before the player is about to shoot a weapon! like this include works on the part once the player shoots a weapon. But that will be called before player shoots a weapon!

In case someone can tell me what to do for it , would appreciate it a lot.

Thank you
Ballu Miaa
Reply
#2

So let me get this straight....

You want your script to somehow read the mind of a player and detect when they're just about to shoot
Reply
#3

If you really want to do something this crazy, sadly it is possible even without reading their minds!

You could use OnPlayerKeyStateChange, and get the new state of "KEY_AIM" and do whatever you please on doing with that, even though people wouldn't aim for half an hour, but It would still work.
Reply
#4

Or just check if the player is Aiming at a player or someone is near to the player. There are many ways to detect it bruh.

And by the way, you are not using Y_hook? Still having difficulties in it?
Reply
#5

Quote:
Originally Posted by Abreezy
Посмотреть сообщение
If you really want to do something this crazy, sadly it is possible even without reading their minds!

You could use OnPlayerKeyStateChange, and get the new state of "KEY_AIM" and do whatever you please on doing with that, even though people wouldn't aim for half an hour, but It would still work.
Just tried to use it under OnPlayerKeyStateChange. That it is called only after the player shoots! Somehow can i get the shooting anim? Anyone knows what is it? I'll try using it under OnPlayerUpdate as it is called often. Lets see if i can make it.

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
Or just check if the player is Aiming at a player or someone is near to the player. There are many ways to detect it bruh.

And by the way, you are not using Y_hook? Still having difficulties in it?
Ayo bro! Holla Happy Diwali. I am having problems in using Y_hooks as well as ALS though i got a little bit from ALS2 lol.

Can you code this with y_hooks? Detecting that player has started Shooting Anim > Has a Weapon.
Reply
#6

Happy & a safe Diwali to you too bro!

OT:
Alright bruh I will try it out.
Reply
#7

As said, detect the fire key. Due to lag this will always be detected as pressed, before the player actually shoots.
Reply
#8

you cant detect someone about to shoot if they dont aim and even if they do aim there is no way to say for sure they would pull the trigger you can try the OnPlayerKey thingy to try to block it from shooting or delay so you can add what you want in between ...but it will get messy
Reply
#9

Thanks for replying guys! Allright i have tried everything with keys! Nothing works. It was always happens after the player shoots because of execution time or you can say lag too.

But isnt there an anim library which will contain all the anims/part of anims related to player shooting?
Reply
#10

the anims are also called AS the player is shooting+the lag of the open callback needed to get playeranim all the time ...i think you will have the same problems there as with keys
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)