[Ajuda] Como defino a life que tiro cada tiro de sniper
#1

Daew galera do foruns samp tenho uma duvida aqui bem gostosona :P, como defino a life que tira cada tiro de sniper do player em que atiro?
Reply
#2

OnPlayerTakeDamage
Reply
#3

pawn Код:
#define SNIPER_DAMAGE 100.0

public OnPlayerTakeDamage(playerid, issuerid, Float:amout, weaponid)
{
    if(weaponid == 34)
    {
        new Float:health[2];
        GetPlayerHealth(playerid, health[0]);
        GetPlayerArmor(playerid, health[1]);

        if(health[1])
        {
            SetPlayerArmor(playerid, health[1] + amout - SNIPER_DAMAGE);
        }
        else
        {
            SetPlayerHealth(playerid, health[0] + amout - SNIPER_DAMAGE);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)