05.08.2017, 07:12
not working.it maybe from OnPlayerDamage from weapon config.because i have animation death
PHP код:
public OnPlayerDamage(&PID, &Float:amount, &issuerid, &weapon, &bodypart)
{
if(god_mode[PID])
return 0;
if(issuerid != INVALID_PLAYER_ID && bodypart == 9 && !IsPlayerAdmin(PID))// I recommend defining bodyparts.
{
if(IsPlayerConnected(issuerid))
{
new string[100], pname[24];
GetPlayerName(PID, headshot, sizeof(headshot));
GetPlayerName(issuerid, pname, sizeof(pname));
format(string, sizeof(string), "%s(%i) was shot in the head by %s(%i)", headshot,PID, pname, issuerid);
scms(0x800000AA,string);
GameTextForPlayer(issuerid,"~r~HeadShot",2000,1);
//PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0);// There is already a ding sound that you can play when someone gets shot.
GameTextForPlayer(PID,"~r~HeadShot",2000,1);
//ClearAnimations(PID);
//ApplyAnimation(PID, "PED", "ko2", 4.1, 1, 1, 1, 1, 1, 1);// Redundant? People already play a custom animation when getting shot in the head and falling down in weapon-config.
//PlayerPlaySound(PID, 17802, 0.0, 0.0, 0.0);// There is already a ding sound that you can play when someone gets shot.
GivePlayerMoney(issuerid, 1000);
GameTextForPlayer(PID,"~w~Wasted",500,2);
amount = 0.0;// If you set the amount of damage to 0.0, it means that it kills the player. As is documented here: https://github.com/oscar-broman/samp-wea...1.66094754
return 1;//Returning 1 to make sure that the damage gets applied right away.
}
}
return 1;
}