Создаем массив для хранение имен игроков, в дальнейшим можете использовать этот массив если захотите.
PHP код:
GetPlayerName(playerid, name[playerid], MAX_PLAYER_NAME);
SetPVarInt(playerid, "headshot", INVALID_PLAYER_ID);
PHP код:
if(issuerid != INVALID_PLAYER_ID)
{
if(bodypart == 9) SetPVarInt(playerid, "headshot", issuerid);
else SetPVarInt(playerid, "headshot", INVALID_PLAYER_ID);
}
PHP код:
new string[102];
SetPVarInt(playerid, "kills", 0);
SetPVarInt(killerid, "kills", GetPVarInt(killerid, "kills")+1);
if(GetPVarInt(playerid, "headshot") == killerid)
{
PlayAudioStreamForPlayer(playerid, "http://geebrox.esy.es/sounds/cs/1.wav");
PlayAudioStreamForPlayer(killerid, "http://geebrox.esy.es/sounds/cs/1.wav");
GameTextForPlayer(playerid, "~r~HeadShot", 3000, 5);
GameTextForPlayer(killerid, "~g~HeadShot", 3000, 5);
format(string, sizeof(string), "%s {8B7D6B}убил {CD950C}%s {8B7D6B}с выстрелом в голову!", name[killerid], name[playerid]);
SendClientMessageToAll(0xCD950CFF, string);
SetPVarInt(playerid, "headshot", INVALID_PLAYER_ID);
}
else if(GetPVarInt(killerid, "kills") > 1)
{
format(string, 37, "http://geebrox.esy.es/sounds/cs/%d.wav", random(8)+1);
PlayAudioStreamForPlayer(killerid, string);
format(string, 12, "~g~Kills: %d!", GetPVarInt(killerid, "kills"));
GameTextForPlayer(killerid, string, 3000, 5);
}