Hi.. i need help .. i want to make a script that count hit
how to make like this ?? the hits only.. others i will do
pawn Код:
new PlayerShootingAt[MAX_PLAYERS];
new PlayerSessionShots[MAX_PLAYERS];
public OnPlayerShootPlayer(Shooter, Target, Float:HealthLost, Float:ArmourLost)
{
if(PlayerShootingAt[Shooter] != Target)
{
PlayerShootingAt[Shooter] = Target;
PlayerSessionShots[Shooter] = 0;
}
PlayerSessionShoots[Shooter]++;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(playerid == PlayerShootingAt[killerid])
{
new playerName[MAX_PLAYER_NAME], killerName[MAX_PLAYER_NAME], deathMessage[128];
GetPlayerName(playerid, playerName, sizeof(playerName));
GetPlayerName(killerid, killerName, sizeof(killerName));
format(deathMessage, sizeof(deathMessage), "* %s(%i) killed player %s(%i) with %i shots." playerName, playerid, killerName, killerid, PlayerSessionShots[killerid]);
SendClientMessaheToAll(0xFFFF00FF, deathMessage);
PlayerShootingAt[killerid] = INVALID_PLAYER_ID;
PlayerSessionShots[killerid] = 0;
}
return 1;
}
Put this together quickly, don't know if it works as I don't have access to a compiler.