[FilterScript] Infective Knife
#1

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]
Reply
#2

Some sort of tetanus, hmm.
Reply
#3

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.
Reply
#4

Quote:
Originally Posted by Pottus
View Post
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)