Detecting Few Process inside an SAMP Server
#1

Hello Everyone,

I've been away from SA-MP Forum for more then a month now. I had no internet. Today I made this thread to know how to detect few process inside an SA-MP Server.
  • How to detect when a Player is Shooting at X,Y,Z Points?
  • How to detect when a Player jumps off from a Z+50 Point and hits on the ground?
  • How to detect two vehicle's colliding with each other?
  • How to detect when a vehicle is colliding with a Player?
If anyone can help me in knowing all this. I would really appreciate it.

Thank you,
Ballu Miaa
Reply
#2

How to detect when a Player is Shooting at X,Y,Z Points?
search for

pawn Код:
IsPlayerAiming(playerid, Float:x, Float:y, Float:z, Float:radius)
Reply
#3

For the player falling from +50, just check under OnPlayerDeath if the reason is 54 (splat). Or you could do some fiddling with animations, check if the player has falling animation and check height.
Reply
#4

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
How to detect when a Player jumps off from a Z+50 Point and hits on the ground?
Detect the 'falling' animation in OnPlayerUpdate, and store their Z coordinate. When they land detect the 'splat' animation and get their new Z height, then find the difference (oldz-curz).

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
How to detect two vehicle's colliding with each other?
If two vehicles lose health at the same time and are very close to each other, you can say with some certainty that they collided.

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
How to detect when a vehicle is colliding with a Player?
Either detect the 'falling over' animation of the player, or use OnPlayerTakeDamage (NOTE: OnPlayerGiveDamage doesn't work with vehicle collisions for some reason).
Reply
#5

Quote:
Originally Posted by [ISS]jumbo
Посмотреть сообщение
How to detect when a Player is Shooting at X,Y,Z Points?
search for

pawn Код:
IsPlayerAiming(playerid, Float:x, Float:y, Float:z, Float:radius)
I dont find any native as such that.

Quote:
Originally Posted by MP2
Посмотреть сообщение
Detect the 'falling' animation in OnPlayerUpdate, and store their Z coordinate. When they land detect the 'splat' animation and get their new Z height, then find the difference (oldz-curz).

If two vehicles lose health at the same time and are very close to each other, you can say with some certainty that they collided.

Either detect the 'falling over' animation of the player, or use OnPlayerTakeDamage (NOTE: OnPlayerGiveDamage doesn't work with vehicle collisions for some reason).
Now that's pretty awesome. THANKS for all the information there ma bro. You have always been a savior.

Rep+6 to MP2
Thank to everyone for replying.
Reply
#6

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Hello Everyone,

I've been away from SA-MP Forum for more then a month now. I had no internet. Today I made this thread to know how to detect few process inside an SA-MP Server.
  • How to detect when a Player is Shooting at X,Y,Z Points?
If anyone can help me in knowing all this. I would really appreciate it.

Thank you,
Ballu Miaa
Here you go ma brah
https://sampforum.blast.hk/showthread.php?tid=140765
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)