OnPlayerHit
#1

Can some one make a OnPlayerHit Callback with the parameters playerid, newhealth, oldhealth, shooterid
Like: OnPlayerHit(playerid, newhealth, oldhealth, shooterid);

And Can some one tell me How to make Plugins?
Reply
#2

Your expecting somebody to tell you in like one sentence how to make all this. OnPlayerHit isnt possible. There was a callback OnPlayerGetShot but it didnt work.
Reply
#3

Well i thought maby someone made a tutorial how to make callbacks and that i couldn't find so they could link me the site

and about the OnPlayerGetShot Too bad ! time for an other try !

Reply
#4

how backwards already said, the callback dont work
you just can make something like OnPlayerLostHealth but how it says everytime you lose health not only shots/fights
Reply
#5

i meant i maby i can try to make an other one and maby it works !
Everything is posible
And i already got a OnPlayerLoseHealth
Reply
#6

If we cound get the pitch of the player's view, or better, the aiming vector of the player, then it could be possible...

But actually you could check,

if player1 is looking at player2 (+/- 5°) and is at a small distance from player2 and if he is firing a weapon then
OnPlayerGetHit(player2) would be called

...but it won't work really nicely because you can't calculate aiming vector of a player, only x and y axis...mean player1 could look at player2, move his mouse to look in the air, fire, and OnPlayerGetHit(player2) will still be called.
Reply
#7

With a plugin you could get exactly where a player is pointing and firing their weapon. Then you record when they fire there weapon and if within a second the player they're aiming at loses health. TBH you could actually make it quite accurate if you knew what you were doing (aslong as players aren't all grouped together).
Reply
#8

Use OnPlayerHitSystem v0.1b and you will take CallBack:
OnPlayerHit(playerid, hiterid, bodypart, weaponid, Float:distance)

Link: http://gta.1nsk.ru/files/OnPlayerHitSystem_v0.1b.rar
Reply
#9

OnPlayerHitSystem v0.2b
http://gta.1nsk.ru/files/OnPlayerHitSystem_v0.2b.rar
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)