SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Filterscripts (https://forum.sa-mp.com/forumdisplay.php?f=17)
-   -   [FilterScript] Knife Shot (https://forum.sa-mp.com/showthread.php?t=599773)

AbyssMorgan 30/01/2016 08:04 AM

Knife Shot
 
Hello, I would like to present you the Knife Shot Script

Video:
https://www.youtube.com/watch?v=WJZCn3XXRHY

Download:
Knife.inc
3DTryg.inc Thread
ColAndreas Plugin

Installation:
PHP Code:

#include <3DTryg>
#include <Knife> 

Functions:
PHP Code:

Knife::ToggleUseTeam(bool:toggle); //default: false
Knife::IsToggleUseTeam();
Knife::ToggleForAll(bool:toggle); //default: false
Knife::IsToggleForAll();
Knife::ToggleForPlayer(playerid,bool:toggle); //default: false
Knife::IsToggleForPlayer(playerid);
Knife::GetDamage(playerid);
Knife::SetDamage(playerid,Float:amount);
Knife::GetSpeed(playerid);
Knife::SetSpeed(playerid,Float:speed);
Knife::GetRange(playerid);
Knife::SetRange(playerid,Float:range);
Knife::GetAmmo(playerid);
Knife::SetAmmo(playerid,ammo);
Knife::TogglePoisoning(playerid,bool:toggle);
Knife::IsTogglePoisoning(playerid);
Knife::GetPoisoningTime(playerid);
Knife::SetPoisoningTime(playerid,seconds);
Knife::GetPoisoningDamage(playerid);
Knife::SetPoisoningDamage(playerid,Float:damage);* 

Callbacks:
PHP Code:

OnPlayerRequestKnifeShot(playerid,targetid); //return 0 - prevent to use knife shoot (this callback is called also if ammo is 0) 

Definitions:
PHP Code:

KNIFE_SPEED
KNIFE_MAX_RADIUS
KNIFE_REFRESH_ACTION
KNIFE_REFRESH_MISS
KNIFE_DAMAGE
KNIFE_WEAPON_AMMO_INFINITY
KNIFE_DOT_POISONING
KNIFE_POISONING_TIME

WEAPON_KNIFE_THROWN
WEAPON_KNIFE_POISONING 

Activation:
PHP Code:

WeaponKnife

Step 1
Right Mouse Button
Step 2
Left Mouse Button 

Notice:
Filterscript not exist because filterscripts have limits.
This has been replaced by include, having automatic installation, efficient GameMode/FilterScript.


Non-Registered Users:
Bug Report

SyS 30/01/2016 08:17 AM

Re: Knife Shot
 
Nice fs +rep

K0P 30/01/2016 08:44 AM

Re: Knife Shot
 
You should increase the speed of the knife a little bit

AbyssMorgan 30/01/2016 08:46 AM

Re: Knife Shot
 
Quote:

Originally Posted by K0P (Post 3649279)
You should increase the speed of the knife a little bit

just change the value
#define KNIFE_SPEED (12.0)

HaRdiiZin 30/01/2016 02:19 PM

Respuesta: Knife Shot
 
Good job.

Amunra 31/01/2016 09:14 AM

Re: Knife Shot
 
Good IDEA ....
But...
Quote:

pawno\include\3DTryg.inc(251) : error 017: undefined symbol "FLOAT_INFINITY"
How to fix ?

AbyssMorgan 31/01/2016 09:16 AM

Re: Knife Shot
 
I recommend update you streamer

From streamer.inc
PHP Code:

#if !defined FLOAT_INFINITY
    #define FLOAT_INFINITY (Float:0x7F800000)
#endif 


Amunra 31/01/2016 09:22 AM

Re: Knife Shot
 
Quote:

Originally Posted by AbyssMorgan (Post 3649975)
I recommend update you streamer

From streamer.inc
PHP Code:

#if !defined FLOAT_INFINITY
    #define FLOAT_INFINITY (Float:0x7F800000)
#endif 


Your Mean Streamer version 2.7.9 ?

AbyssMorgan 31/01/2016 09:25 AM

Re: Knife Shot
 
Quote:

Originally Posted by Amunra (Post 3649978)
Your Mean Streamer version 2.7.9 ?

Yes

Check your streamer.inc whether it has FLOAT_INFINITY

//edit: the problem will be fixed in version 3DTryg.inc 2.1G

Amunra 31/01/2016 09:28 AM

Re: Knife Shot
 
Quote:

Originally Posted by AbyssMorgan (Post 3649979)
Yes

Check your streamer.inc whether it has FLOAT_INFINITY

Can you give me a Download Link From Solidfiles ?
-a Pack Plugins Of Streamer 2.7.9-

My Computer Has Problem With opening Github link !

AbyssMorgan 31/01/2016 09:31 AM

Re: Knife Shot
 
Quote:

Originally Posted by Amunra (Post 3649982)
Can you give me a Download Link From Solidfiles ?
-a Pack Plugins Of Streamer 2.7.9-

My Computer Has Problem With opening Github link !

http://www.solidfiles.com/d/e7fb939a26/

Amunra 31/01/2016 09:34 AM

Re: Knife Shot
 
Quote:

Originally Posted by AbyssMorgan (Post 3649983)

Ok thanks :D
Rep+ added,Check this..

AbyssMorgan 01/02/2016 04:36 PM

Re: Knife Shot
 
Hello, after a recent renovation 3DTryg.inc found a bug in IsPointNearly2Points(2D/3D).
By what the script Knife Shot does not work properly as the last film.
Bug has been fixed in 3DTryg.inc v2.2

AbyssMorgan 09/04/2016 06:15 AM

Re: Knife Shot
 
Error with a knife at the fleeing of many players, fixed :)

AbyssMorgan 16/06/2016 04:44 PM

Re: Knife Shot
 
Update 1.9:
Added detection team player for SetPlayerTeam(playerid, teamid);
with active:
PHP Code:

ToggleUseTeamKnifeShoot(bool:toggle); //default: false 


MBilal 16/06/2016 04:52 PM

Re: Knife Shot
 
Unique +Rep

samp_boy 17/06/2016 04:01 AM

Re: Knife Shot
 
good work!

suggestion: change the sound effect when u get hit by the knife.

AbyssMorgan 17/06/2016 06:54 AM

Re: Knife Shot
 
Quote:

Originally Posted by samp_boy (Post 3718326)
good work!

suggestion: change the sound effect when u get hit by the knife.

Suggestion, what could be the sound ? :D

samp_boy 18/06/2016 03:48 AM

Re: Knife Shot
 
Quote:

Originally Posted by AbyssMorgan (Post 3718372)
Suggestion, what could be the sound ? :D

a sort of ding ding! there you go! i got it for ya:
Code:

PlayerPlaySound(playerid,17802,0.0,0.0,0.0);

AbyssMorgan 18/06/2016 02:52 PM

Re: Knife Shot
 
Quote:

Originally Posted by samp_boy (Post 3719000)
a sort of ding ding! there you go! i got it for ya:
Code:

PlayerPlaySound(playerid,17802,0.0,0.0,0.0);

Added sound.

To turn off you must add before include:
PHP Code:

#define DISABLE_KNIFE_SOUND 


AbyssMorgan 18/06/2016 08:18 PM

Re: Knife Shot
 
Update 2.1:
function call OnPlayerGiveDamage / OnPlayerTakeDamage when the knife hits

AbyssMorgan 22/06/2016 08:00 PM

Re: Knife Shot
 
Update 2.2:

Added functions:
PHP Code:

ToggleKnifeShootForAll(bool:toggle);             //default: true 
bool:IsToggleKnifeShootForAll();                   
ToggleKnifeShootForPlayer(playerid,bool:toggle); //default: false 
bool:IsToggleKnifeShootForPlayer(playerid); 


Owen007 22/06/2016 08:15 PM

Re: Knife Shot
 
keep up the awesome work.

AbyssMorgan 19/02/2017 01:42 PM

Re: Knife Shot
 
Update v2.4.0:

- Update for 3DTryg v4.0.2 !

- Added collision detect

- Removed options:
PHP Code:

DISABLE_KNIFE_SOUND Now use OnPlayerGiveDamage OnPlayerTakeDamage
USE_OLD_KNIFE_DATIVE
DISABLE_KNIFE_CALL_DAMAGE 
3DTryg already call OnPlayerGiveDamage OnPlayerTakeDamage 


Sumit4 19/02/2017 04:34 PM

Re: Knife Shot
 
Nice FS

justice96 19/02/2017 05:02 PM

Re: Knife Shot
 
Will try it soon!

AbyssMorgan 22/02/2017 06:08 PM

Re: Knife Shot
 
Update v2.5.0:

- Added functions:
PHP Code:

Float:GetKnifeShootDamage(playerid);
SetKnifeShootDamage(playerid,Float:amount);
Float:GetKnifeShootSpeed(playerid);
SetKnifeShootSpeed(playerid,Float:speed);
Float:GetKnifeShootRange(playerid);
SetKnifeShootRange(playerid,Float:range); 


AbyssMorgan 23/02/2017 06:35 PM

Re: Knife Shot
 
Update v2.5.1:
- Fixed latest update bugs (Weapon not working).

Variable™ 23/02/2017 06:52 PM

Re: Knife Shot
 
Gotcha, keep up the work.

KatarinaCalzaghe 13/02/2018 02:45 PM

Re: Knife Shot
 
Update v2.6.0:

- Added Functions:
PHP Code:

GetKnifeShootAmmo(playerid);
SetKnifeShootAmmo(playerid,ammo); 

- Added Callbacks:
PHP Code:

OnPlayerRequestKnifeShot(playerid,targetid); //return 0 - prevent to use knife shoot (this callback is called also if ammo is 0) 

- Added Definitions:
PHP Code:

KNIFE_WEAPON_AMMO_INFINITY 


Astralis 17/02/2018 09:18 PM

Re: Knife Shot
 
Really interesting to see this!

AbyssMorgan 11/10/2019 02:00 PM

Re: Knife Shot
 
Update v2.7.0:

- Changed default value for Knife::ToggleForAll(bool:toggle); as false

- Knife shot is disabled on player connect, config is reset to default

- Renamed functions:
PHP Code:

ToggleUseTeamKnifeShoot -> Knife::ToggleUseTeam
IsToggleUseTeamKnifeShoot 
-> Knife::IsToggleUseTeam
ToggleKnifeShootForAll 
-> Knife::ToggleForAll
IsToggleKnifeShootForAll 
-> Knife::IsToggleForAll
ToggleKnifeShootForPlayer 
-> Knife::ToggleForPlayer
IsToggleKnifeShootForPlayer 
-> Knife::IsToggleForPlayer
GetKnifeShootDamage 
-> Knife::GetDamage
SetKnifeShootDamage 
-> Knife::SetDamage
GetKnifeShootSpeed 
-> Knife::GetSpeed
SetKnifeShootSpeed 
-> Knife::SetSpeed
GetKnifeShootRange 
-> Knife::GetRange
SetKnifeShootRange 
-> Knife::SetRange
GetKnifeShootAmmo 
-> Knife::GetAmmo
SetKnifeShootAmmo 
-> Knife::SetAmmo 

- Added functions:
PHP Code:

Knife::TogglePoisoning(playerid,bool:toggle);
Knife::IsTogglePoisoning(playerid);
Knife::GetPoisoningTime(playerid);
Knife::SetPoisoningTime(playerid,seconds);
Knife::GetPoisoningDamage(playerid);
Knife::SetPoisoningDamage(playerid,Float:damage); 

- Added definitions:
PHP Code:

KNIFE_DOT_POISONING
KNIFE_POISONING_TIME

WEAPON_KNIFE_THROWN
WEAPON_KNIFE_POISONING 

Video:
https://www.youtube.com/watch?v=PSfgKwm3Mc8

IzadorO 11/10/2019 02:18 PM

Re: Knife Shot
 
Going to try this out today, it seems very nice! I can see it having use on a lot of server types. Well done again.


All times are GMT. The time now is 10:22 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.