OnPlayerGiveDamage
#1

Hi.. i need help .. i want to make a script that count hit

like

when you die

a textdraw will come

Killed By: %s
He Did %d Damage with %d hits

how to make like this ?? the hits only.. others i will do


any one please
Reply
#2

http://forum.sa-mp.com/showthread.ph...highlight=opsp
Reply
#3

Quote:
Originally Posted by Scott Zulkifli
Посмотреть сообщение
HITS Goddamn it!

i want hits!
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)