public OnPlayerTakeDamage ( playerid, issuerid, Float:amount, weaponid, bodypart ) {
if(issuerid != INVALID_PLAYER_ID && weaponid == 34, 33 && bodypart == 9)
{
SetPlayerHealth(playerid, 0.0);
GameTextForPlayer(issuerid,"~g~HEADSHOT",2000,3);
GameTextForPlayer(playerid,"~r~HEAD~y~SHOT",2000,3);
}
return 1;
}
weaponid == 34, 33
weaponid == 34 || weaponid == 33
pawn Код:
pawn Код:
|
new bodypart;
// I don't believe that's the sound ID for the sound you're looking for.
PlayerPlaySound(playerid, 17802, 0.0, 0.0, 0.0);
PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0);
if(gTeam[issuerid] == gTeam[playerid])
{
GameTextForPlayer(issuerid,"~r~Don't attack your team mates!", 3000, 3);
}
if(issuerid != INVALID_PLAYER_ID)
{
new str[26];
format(str, sizeof(str),"-%.0f", amount);
SetPlayerChatBubble(playerid, str, 0xFF0000FF, 100.0, 2000);
PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
}
if(PlayerInfo[playerid][OnDuty] == 1 || PlayerInfo[playerid][God] == 1)
{
SetPlayerHealth(playerid, 1000.0);
GameTextForPlayer(issuerid,"~r~Don't attack admins on-duty!", 3000, 3);}
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 || weaponid == 33 && bodypart == 9)
{
SetPlayerHealth(playerid, 0.0);
GameTextForPlayer(issuerid,"~g~HEADSHOT",2000,3);
GameTextForPlayer(playerid,"~r~HEAD~y~SHOT",2000,3);
}
return 1;
}
if((issuerid != INVALID_PLAYER_ID && weaponid == 34) || (weaponid == 33 && bodypart == 9))
if(issuerid != INVALID_PLAYER_ID && (weaponid == 34 || weaponid == 33) && bodypart == 9)
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid,bodypart) { if(issuerid != INVALID_PLAYER_ID) { if(GetPlayerTeam(issuerid) != GetPlayerTeam(playerid)) { if((weaponid == 34) && bodypart == 9) { SetPlayerHealth(playerid, 0.0); GameTextForPlayer(issuerid, "~r~Head shot!", 3000, 3); GameTextForPlayer(playerid, "~r~Head shot!", 3000, 3); } else return PlayerPlaySound(issuerid,17802,0.0,0.0,0.0); }else {GameTextForPlayer(issuerid, "~w~don't shoot team mates", 3000, 3);} } return 0; }
use it is only for sniper and rep me if i help you
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid,bodypart) { if(issuerid != INVALID_PLAYER_ID) { if(GetPlayerTeam(issuerid) != GetPlayerTeam(playerid)) { if((weaponid == 34) && bodypart == 9) { SetPlayerHealth(playerid, 0.0); GameTextForPlayer(issuerid, "~r~Head shot!", 3000, 3); GameTextForPlayer(playerid, "~r~Head shot!", 3000, 3); } else return PlayerPlaySound(issuerid,17802,0.0,0.0,0.0); }else {GameTextForPlayer(issuerid, "~w~don't shoot team mates", 3000, 3);} } return 0; } |
#define BODY_PART_TORSO 3 #define BODY_PART_GROIN 4 #define BODY_PART_LEFT_ARM 5 #define BODY_PART_RIGHT_ARM 6 #define BODY_PART_LEFT_LEG 7 #define BODY_PART_RIGHT_LEG 8 #define BODY_PART_HEAD 9 |