Simple Custom Damage/Knockout/Shock system
Hello everybody, I decided to share my filterscript with ya all, didn't release anything since I joined so I decided to spare some change 0.0.
- Custom Damage for shots
- Shock system - It sets your drunk level to 8000 for XXX seconds(Depends on the gun), and keeps moving the screen.
- Message when you get shot
- Knockout system - When you get pushed by a melee gun, you get knocked on the ground with a special animation for 30 secs, and won't be able to move
Alright, custom damage system is simple and useful aswell, here's the damages for the guns:
Code:
Assault Machines (M4-AK47) | -20 Damage + Shock for ten haundred seconds.
Glock 49. (9mm) | -45 Damage + Shock for ten haundred seconds.
Glock. 47 D-E S. (Deagle) | -40 Damage + Shock for ten haundred seconds.
Sniper Rifle | Kills you or injuries you, depends on your script.
Katana | -60 Damage + Knockout for thirty seconds + Shock for ten haundred seconds.
Baseball Bat | -40 Damage + Knockout for twenty seconds + Shock for fifty seconds.
Baton (Nitestick) | -50 Damage + Knockout for fifty seconds + ten haundred and fifty seconds.
Cane/Knife/Golf Club/Shovel/Pool Cue | -30 Damage + Knockout for five seconds.
[REMOVED]Remington 97. Sawnoff (Sawnoff Shotgun) | -10 Damage/x2-4 + Shock for two haundred seconds.
Code:
Sniper Rifle | Removes all the armour.
Katana | -30 Armour Damage.
Cane/Knife/Golf Club/Shovel/Pool Cue | -10 Armour Damage.
And finally here's the code.
Code:
#include <a_samp>
forward Knocked(playerid);
public Knocked(playerid)
{
SendClientMessage(playerid, -1, "You are able to move now");
TogglePlayerControllable(playerid, 1);
return 1;
}
forward ClearShock(playerid);
public ClearShock(playerid)
{
SetPlayerDrunkLevel(playerid, 0);
return 1;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#include <a_samp>
forward Knocked(playerid);
public Knocked(playerid)
{
SendClientMessage(playerid, -1, "You are able to move now");
TogglePlayerControllable(playerid, 1);
return 1;
}
forward ClearShock(playerid);
public ClearShock(playerid)
{
SetPlayerDrunkLevel(playerid, 1);
return 1;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
new Float:HP;
new Float:Armor;
GetPlayerHealth(playerid, HP);
GetPlayerArmour(playerid, Armor);
if(Armor < 1)
{
if(weaponid == 31 || weaponid == 30)
{
SetPlayerHealth(playerid, HP-(amount*3));
SendClientMessage(playerid, -1, "You were shot by assault rifle and got shocked.");
SetPlayerDrunkLevel(playerid, 8000);
SetTimerEx("ClearShock", 100000, false, "i", playerid);
}
else if(weaponid == 22)
{
SetPlayerHealth(playerid, HP-45);
SendClientMessage(playerid, -1, "You were shot by glock.49 and got shocked.");
SetPlayerDrunkLevel(playerid, 8000);
SetTimerEx("ClearShock", 100000, false, "i", playerid);
}
else if(weaponid == 34)
{
SetPlayerHealth(playerid, HP-100);
SendClientMessage(playerid, -1, "You were shot by a sniper rifle and died.");
SetPlayerDrunkLevel(playerid, 8000);
SetTimerEx("ClearShock", 100000, false, "i", playerid);
}
else if(weaponid == 8)
{
SetPlayerHealth(playerid, HP-40);
SendClientMessage(playerid, -1, "You have been knocked to the floor by a melee gun.");
ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,0,0,0,0);
SetTimerEx("Knocked", 10000, false, "i", playerid);
TogglePlayerControllable(playerid, 0);
SetPlayerDrunkLevel(playerid, 8000);
SetTimerEx("ClearShock", 100000, false, "i", playerid);
}
else if(weaponid == 5)
{
SetPlayerHealth(playerid, HP-40);
new hitrand = random(10);
if(hitrand <= 1)
{
SendClientMessage(playerid, -1, " You have been knocked to the floor by a baseball bat.");
ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,0,0,0,0);
SetTimerEx("Knocked", 10000, false, "i", playerid);
TogglePlayerControllable(playerid, 0);
SetPlayerDrunkLevel(playerid, 8000);
SetTimerEx("ClearShock", 100000, false, "i", playerid);
}
}
else if(weaponid == 3)
{
SetPlayerHealth(playerid, HP-40);
new hitrand = random(10);
if(hitrand <= 1)
{
SendClientMessage(playerid, -1, " You have been knocked to the floor by an ASP Baton.");
ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,0,0,0,0);
SetTimerEx("Knocked", 10000, false, "i", playerid);
TogglePlayerControllable(playerid, 0);
SetPlayerDrunkLevel(playerid, 8000);
SetTimerEx("ClearShock", 100000, false, "i", playerid);
}
}
else if(weaponid == 15 || weaponid == 4 || weaponid == 2 || weaponid == 6 || weaponid == 7)
{
SetPlayerHealth(playerid, HP-30);
SendClientMessage(playerid, -1, "You have been knocked to the floor by a melee gun.");
ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,0,0,0,0);
SetTimerEx("Knocked", 10000, false, "i", playerid);
TogglePlayerControllable(playerid, 0);
SetPlayerDrunkLevel(playerid, 8000);
SetTimerEx("ClearShock", 100000, false, "i", playerid);
}
}
}
return 1;
}
This script is to be updated weekly/monthly, new features that i'm planning to add:
- Headshot system for sniper.
- Bleeding system.
- More, just suggest me what to add, please.
Please make sure to leave a rate/comment.
I'd appreciate if someone captured screenshots for me, or wait until I capture few, waiting for my friends to take screenshots with this, I can't capture screenshots alone 0.0