[ALPHA] Throwing-Knife - A new kind of weapon -
codectile - 29.09.2014
Throwing-Knife
Intoduction
[
CLEAN] I saw a video on ******* about throwing knives in samp, and I was too eager to make it. This include let you to create some deadly throwing knives for each player, these knives can reduce target's health percentage whenever the target gets hit by these knives. The reduction in the health percentage of the target varies from a range of 0 to 100. This is more a script rather than an include.
Code:
NOTE:
Uses PlayerAttachedObject slot '0','1','2','3'.
Versions
[
c1] This is a c1 version of throwing-knives, There are some new features added to it. Now aiming completely depends upon player's crosshair. Players can throw knives vertically upwards and downwards.
Enhances gameplay as well. [
Source Code go through the documentary present in the source code ]
Functions
•EquipPlayerThrowingKnife(playerid,color=-1) //"color" of the crosshair is optional
•RemoveAttachedKnives(playerid)
•UnEquipPlayerThrowingKnife(playerid)
•RemovePlayerThrowingKnife(playerid)
•GivePlayerThrowingKnife(playerid,amount)
•LetPlayerThrowKnife(playerid, clienterror[], errorcolor)
• OnPlayerThrowKnife(playerid) - Callback
• OnPlayerGetKnifed(playerid, killerid) - Callback
Dependencies
• Streamer Plug-in (incognito)
Bugs
• None yet.
Credits
• Incognito
Download
******Drive
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
JonathanW - 29.09.2014
VERY good! Repped C:
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
codectile - 29.09.2014
UPDATE
• Video added.
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
iZN - 29.09.2014
Remembers me of murderer mode in Garry's mod and throwing knifes in POSTAL 2. You might want to fix your indentation as it looks so weird. Other than, good work.
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
codectile - 29.09.2014
@iZN: It is the github who makes the indentation look weird. Anyway, I'll fix it.
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
ZombieNest - 29.09.2014
Nice, +REP, I was searching for this from years, At last I got it.
I'm allowed to fix the bugs right?
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
codectile - 29.09.2014
@Zombie_Nest: Yes you can, but at least inform me about the bugs so that I can fix them for my future updates.
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
KingServerIRAN - 29.09.2014
Vary nice +rep
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
Lordzy - 29.09.2014
The knife's position should be more closer to the player while throwing because it just looks like a knife appeared and goes through a straight line with great speed. You could get the knife more closer and increase it's speed only after it starts moving a bit.
Also, instead of doing "IsValidDynamicObject" check under OnPlayerUpdate always, go through OPU only if a variable is set. A single variable could be faster than IsValidDynamicObject check.
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
codectile - 29.09.2014
@Lordzy:
1. The position of the knife is very close to the player, it is a streaming/processing problem.
Quote:
Originally Posted by Lordzy
You could get the knife more closer and increase it's speed only after it starts moving a bit.
|
2. ^^ It is very difficult to do that. (Everything is not much possible in 2004's game)
3. It's a very complicated script and editing a single core thingy, is like banging your head on the wall.
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
Lordzy - 29.09.2014
Quote:
Originally Posted by codectile
@Lordzy:
2. ^^ It is very difficult to do that. (Everything is not much possible in 2004's game)
|
I suggested you that because it's actually able to. At first you can move the object with a speed to lesser distance and then use OnObjectMoved callback to do the rest.
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
Sajjawal_Funter - 29.09.2014
nice !
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
codectile - 29.09.2014
Quote:
Originally Posted by Lordzy
I suggested you that because it's actually able to. At first you can move the object with a speed to lesser distance and then use OnObjectMoved callback to do the rest.
|
After performing the above, the knife will get a observable halt for few milliseconds in air, which will look too odd. Though the movement will not be smooth.
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
Stefan10 - 29.09.2014
Nice Work man
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
Lordzy - 29.09.2014
Quote:
Originally Posted by codectile
After performing the above, the knife will get a observable halt for few milliseconds in air, which will look too odd. Though the movement will not be smooth.
|
I'm not completely sure about that however I've used such a technique on one of my include named L_SAM and it seemed to work pretty fine. Though, I used to check the position on a timer and then call OnObjectMoved script sided. I'm not really FORCING you to do something like that, it's just a suggestion to improve the way it looks.
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
vignesh007 - 29.09.2014
+1 nice thing man
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
Steel_ - 29.09.2014
This is very nice, here's my little test script i made
http://pastebin.com/DAmMRydA
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
codectile - 29.09.2014
@Wizdo: Glad to see that you used OnPlayerKeyStateChange.
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
Steel_ - 29.09.2014
REMOVE: i didnt fully read the post
Re: [ALPHA] Throwing-Knife - A new kind of weapon -
codectile - 01.10.2014
UPDATE 1:
• Added crosshair for accuracy.
• Damage range now varies from 0-20.
• Improved functions.
• Added callback "OnPlayerThrowKnife(playerid)"
-------
A new video for the BETA release will be uploaded soon.
-------
Need beta testers. (approximately 4 testers)