[Include] k_target - Create a target easily [0.3Z]
#1

About
I created this project on 2014. 01. 21.. This is my first project on GitHub, and it was hard to set up GitHub at the first time, and also i had no time to deal with it. Now it's weekend! (And my internet connection is slow too, it took a half day to upload the demonstration video).
This include only works with SA-MP 0.3z (and higher versions).

This include allows you to create a targets. It looks like a real player, but it made from objects. You can do anything with it, only your imagination is needed. It's up to you!
It has a body part detection, so you can check where did you shoot the bullet.

Definitions
Код:
#define MOVE_FORWARD    	        0
#define MOVE_BACKWARD   	        1
#define MOVE_LEFT   		        2
#define MOVE_RIGHT   		        3

#define TORSO      			3
#define LEFT_ARM   			5
#define RIGHT_ARM 			6
#define RIGHT_LEG   		        8
#define LEFT_LEG   			7
#define HEAD   				9
Functions
Код:
native CreateTarget(Float:Tx, Float:Ty, Float:Tz, Float:FacingAngle); // Returns with the target's ID
native SetTargetFacingAngle(targetid, Float:FacingAngle);
native SetTargetPos(targetid, Float:Tx, Float:Ty, Float:Tz);
native GetTargetPos(targetid, &Float:Tx, &Float:Ty, &Float:Tz);
native MoveTarget(targetid, direction, Float:distance);
native MoveTargetEx(targetid, Float:X, Float:Y, Float:Z, Float:Speed, Float:FacingAngle);
native DestroyBodyPart(targetid, bodypart); // NOTE: If you destroy the torso, all body parts will be destroyed.
native DestroyTarget(targetid);
native IsValidTarget(targetid);
Callbacks
Код:
public OnTargetMoved(targetid)
public OnPlayerShotTarget(playerid, targetid, bodypart, Float:Tx, Float:Ty, Float:Tz)
Bugs
I didn't find any bugs. If you do, please contact me, and i will fix it.

Video

[ame]http://www.youtube.com/watch?v=EeiNRthltjg[/ame]



Example filterscript
https://raw2.github.com/kadaradam/k_...ts/example.pwn

And the filterscript is also available at the project's main folder(filterscripts/example.pwn).

Download
You can download the project on github.


Click here


Credits
kadaradam - Creator

If you have any suggestions please leave a comment. And sorry for my english.
Reply
#2

Nice well done
Reply
#3

Seems good, could be used for creating shooting practices. Keep up!
Reply
#4

I don't see the point of defining all the different hit types the user should do that all you really need is one hit type to simplify your code. There is so much stuff hard coded into this system it serves little purpose I think.
Reply
#5

Not bad idea, do like. If you shoot the torso, does the whole thing disappear?
Reply
#6

How to make them move? And can this be done with deers too?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)