03.01.2017, 10:41
I want to make this headshot system, so example:
when i shoot a player it should show:
Areeb has been shoot by XBoss30 to the head and XBoss30 has earned $100
here is my code:
On top of the script
new headshot[MAX_PLAYERS];
when i shoot a player it should show:
Areeb has been shoot by XBoss30 to the head and XBoss30 has earned $100
here is my code:
On top of the script
new headshot[MAX_PLAYERS];
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(IsPlayerConnected(issuerid))
{
if(bodypart == 9)
{
SetPlayerHealth(playerid, 0.0);
new string[100];
GetPlayerName(playerid, headshot, sizeof(headshot));
format(string, sizeof(string), "%s was shoot to the head by %d and %d has earned $100", headshot, issuerid);
GivePlayerMoney(issuerid, 100);
SendClientMessageToAll(COLOR_RED,string);
GameTextForPlayer(issuerid,"~r~Headshot",2000,3);
PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid,"~r~Headshot",2000,3);
PlayerPlaySound(playerid, 17802, 0.0, 0.0, 0.0);
}
}
}
return 1;
}