[FilterScript] Samp custom damage system
#1

Hey guys ,i have made a custom damage system ,with the bodyparts like each bodypart got different damage..
The code is not long so i will post it here...
pawn Код:
public OnFilterScriptInit()
{
    printf("Damage system by Nurgle ");
    return 1;
}
public OnFilterScriptExit()
{
    printf("Damage system by Nurgle ");
    return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && bodypart == 3)//which means torso
    {
        SetPlayerArmour(playerid, GetPlayerArmour(playerid)-50);
        SetPlayerHealth(playerid, GetPlayerHealth(playerid)-50);//you can change the 50 to any number you want...
    }
    if(issuerid != INVALID_PLAYER_ID && bodypart == 4)//which means groin
    {
        SetPlayerArmour(playerid, GetPlayerArmour(playerid)-45);
        SetPlayerHealth(playerid, GetPlayerHealth(playerid)-45);//you can change the 45 to any number you want...
    }
    if(issuerid != INVALID_PLAYER_ID && bodypart == 5)//which means left arm
    {
        SetPlayerArmour(playerid, GetPlayerArmour(playerid)-35);
        SetPlayerHealth(playerid, GetPlayerHealth(playerid)-35);//you can change the 35 to any number you want...
    }
    if(issuerid != INVALID_PLAYER_ID && bodypart == 6)//which means right arm
    {
        SetPlayerArmour(playerid, GetPlayerArmour(playerid)-35);
        SetPlayerHealth(playerid, GetPlayerHealth(playerid)-35);//you can change the 35 to any number you want...
    }
    if(issuerid != INVALID_PLAYER_ID && bodypart == 7)//which means left leg
    {
        SetPlayerArmour(playerid, GetPlayerArmour(playerid)-40);
        SetPlayerHealth(playerid, GetPlayerHealth(playerid)-40);//you can change the 40 to any number you want...
    }
    if(issuerid != INVALID_PLAYER_ID && bodypart == 8)//which means right leg
    {
        SetPlayerArmour(playerid, GetPlayerArmour(playerid)-40);
        SetPlayerHealth(playerid, GetPlayerHealth(playerid)-40);//you can change the 40 to any number you want...
    }
    if(issuerid != INVALID_PLAYER_ID && bodypart == 9)//which means head
    {
        SetPlayerArmour(playerid, GetPlayerArmour(playerid)-100);
        SetPlayerHealth(playerid, GetPlayerHealth(playerid)-100);//you can change the 100 to any number you want...
    }
    return 1;
}
And you can just change the damage amount to whatever you want..
How to let it work:
First of all open pawno,then paste the code and compile it.
If you made it as filterscript go to server.cfg and add the name of the filterscript after "filterscripts"
If you added it into your gamemode then just restart the server and it will work
Credits:
Me for scripting the code
Samp for the pawno.

Enjoy!!!!
Reply
#2

decent work

BTW if i am not wrong samp didnt make pawno...
Reply
#3

how about if the player has armor?
Reply
#4

@burnuk if the player had armour add SetPlayerArmour at the code example:
pawn Код:
if(issuerid != INVALID_PLAYER_ID && bodypart == 9)//which means head
    {
        SetPlayerArmour(playerid, GetPlayerArmour(playerid)-+ you preference); // bla bla :)
        SetPlayerHealth(playerid, GetPlayerHealth(playerid)-100);//you can change the 100 to any number you want...
    }
P.S. Useful and easy !
Reply
#5

I've never seen this one before... I'll be giving you a 0 for releasing something that can be seen everywhere... Once you make something that doesn't pop up with 1000 different scripts/includes on ******, you'll get a REP+.
Reply
#6

Quote:
Originally Posted by terrow
Посмотреть сообщение
@burnuk if the player had armour add SetPlayerArmour at the code example:
pawn Код:
if(issuerid != INVALID_PLAYER_ID && bodypart == 9)//which means head
    {
        SetPlayerArmour(playerid, GetPlayerArmour(playerid)-+ you preference); // bla bla :)
        SetPlayerHealth(playerid, GetPlayerHealth(playerid)-100);//you can change the 100 to any number you want...
    }
P.S. Useful and easy !
i know how to do it man... i just gave the TS a tip since his script is lacking.

and the script you showed me is also inconsistent... your making every shot decrease armor and health at the same time. So by that a player with full armor and hp is just the same as a player with only full hp and no armor.....
Reply
#7

Okay i will edit the armor thingy
By the way i am not posting these filterscripts only for reps,i am just trying to help the other scripters
Reply
#8

Hope you guys like it.
Reply
#9

Okay guys,i have edited the armor thingy,now it's without anything wrong,have fun
Reply
#10

I will Try this out.
Nice Work Maybe.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)