24.08.2016, 05:20
This is pretty cool, but I must say. Bodypart 9 isn't defined. Change:
TO
ALSO
This is only for a sniper-rifle? If so, announce that.
Since OnFilterScriptInit & OnFilterScriptExit do nothing to the script itself, you can get rid of 16 lines of not needed code. Delete:
Quote:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) { if( GetPlayerTeam(issuerid) != GetPlayerTeam(playerid)) { if(weaponid == 34 && bodypart == 9) { if(Helmet[playerid] == 1) { Helmet[playerid] = 0; SendClientMessage(playerid, -1, "Your helmet has absorbed the sniper bullet and you have delt no damage!"); RemovePlayerAttachedObject(playerid, 1); } else { SetPlayerHealth(playerid, 0); GameTextForPlayer(playerid, "~r~Headshot!", 5000, 2); } } } return 1; } |
Quote:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) { if( GetPlayerTeam(issuerid) != GetPlayerTeam(playerid)) { if(weaponid == 34 && bodypart == BODY_PART_HEAD) { if(Helmet[playerid] == 1) { Helmet[playerid] = 0; SendClientMessage(playerid, -1, "Your helmet has absorbed the sniper bullet and you have delt no damage!"); RemovePlayerAttachedObject(playerid, 1); } else { SetPlayerHealth(playerid, 0); GameTextForPlayer(playerid, "~r~Headshot!", 5000, 2); } } } return 1; } |
This is only for a sniper-rifle? If so, announce that.
Since OnFilterScriptInit & OnFilterScriptExit do nothing to the script itself, you can get rid of 16 lines of not needed code. Delete:
Quote:
#if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Headshot system by Deeadpool"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #endif |