[FilterScript] Infective Knife - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Infective Knife (
/showthread.php?tid=599346)
Infective Knife -
K0P - 24.01.2016
Infective Knife
This is a simple filterscript in which players are able to buy an infective knife and use it only 1 time,the infective knife reduces 50 health of a player in 5 second is the player is hit by it.
Commands
/iknife - buy the infective knife
Setting Custom Knife Cost
Code:
//Here you can change the cost of the infective knife
#define KNIFE_COST 1000
[Source Code]
Re: Infective Knife -
Tamer - 24.01.2016
Some sort of tetanus, hmm.
Re: Infective Knife -
Pottus - 24.01.2016
Let me just point out some flaws here.
1.) You assign the timerid to a variable you only do this when you actually need to kill the timer later in your case this would be when a player disconnects so there should be an array here for each player. The problem here is if a player logs out another connects the connecting player will have that code run on them. Also consider this code will fail here if another timer is set you kill a timer but which one? If two players use this you will have lost your reference!
Code:
public Damage(playerid)
{
if(damage[playerid] == 5)
{
KillTimer(timer);
2.) I don't like the RemovePlayerWeapon() function this function is primed for exploitation just by sending false weapon data it could be possible to fool even server sided ammo amounts.
3.) Overall it's pretty simple you should really think about adding some more substance.
Re: Infective Knife -
K0P - 25.01.2016
Quote:
Originally Posted by Pottus
Let me just point out some flaws here.
1.) You assign the timerid to a variable you only do this when you actually need to kill the timer later in your case this would be when a player disconnects so there should be an array here for each player. The problem here is if a player logs out another connects the connecting player will have that code run on them. Also consider this code will fail here if another timer is set you kill a timer but which one? If two players use this you will have lost your reference!
Code:
public Damage(playerid)
{
if(damage[playerid] == 5)
{
KillTimer(timer);
2.) I don't like the RemovePlayerWeapon() function this function is primed for exploitation just by sending false weapon data it could be possible to fool even server sided ammo amounts.
3.) Overall it's pretty simple you should really think about adding some more substance.
|
Oh,thanks for that.
Ill didn't thought about that,i was sleepy xD