25.02.2014, 20:04
(
Последний раз редактировалось Nurgle4; 27.02.2014 в 10:45.
)
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...
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!!!!
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;
}
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!!!!