SA-MP Forums Archive
[FilterScript] Samp custom damage system - 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] Samp custom damage system (/showthread.php?tid=497236)



Samp custom damage system - Nurgle4 - 25.02.2014

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!!!!


Re: Samp custom damage system - Ozil - 25.02.2014

decent work

BTW if i am not wrong samp didnt make pawno...


Re: Samp custom damage system - burnuk - 25.02.2014

how about if the player has armor?


Re: Samp custom damage system - terrow - 25.02.2014

@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 !


Re: Samp custom damage system - Abagail - 25.02.2014

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+.


Re: Samp custom damage system - burnuk - 25.02.2014

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.....


Re: Samp custom damage system - Nurgle4 - 26.02.2014

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


Re: Samp custom damage system - Nurgle4 - 26.02.2014

Hope you guys like it.


Re: Samp custom damage system - Nurgle4 - 27.02.2014

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


Re: Samp custom damage system - THE_KING$5$ - 27.02.2014

I will Try this out.
Nice Work Maybe.