[AJUDA] Aumentar Dano Da Sniper
#1

Gente eu sei que deve ter algum tуpico com isso, mas usei o search e nao achei , so achei uma coisa mas, Fail.
Eu queria colocar no meu GM que o dano da sniper fosse maior tipo 1 tiro tira o colete e outro o Hp.
Alguem sabe fazer?!
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=195439

PHP код:
#include <a_sa-mp>
#include <OPSP>
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    if(
GetPlayerWeapon(Shooter) == 34
    {
        new 
Float:a[2];
        
GetPlayerArmour(Target,a[0]);
        if(
a[0] > 0.0) return SetPlayerArmout(Target,0.0);
        
GetPlayerHealth(Target,a[1]);
        if(
a[1]) > 0.0) return SetPlayerHealth(Target,0.0);
    }
    return 
true;

Reply
#3

Presente
pawn Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    //#define SHOOTSYSTEM_DEBUG
    new Weapon = GetPlayerWeapon( Shooter ),
        Float:Damage = 0; //Adicional. Ou Seja, isso mais o damage da prуpria arma

    if( Weapon == 22 ) Damage = 28.0; // Colt .45
    if( Weapon == 23 ) Damage = 35.0; // Silenced Colt .45
    if( Weapon == 24 ) Damage = 20.0; // Deagle/Glock
    if( Weapon == 25 ) Damage = 10.0; // Shotgun
    if( Weapon == 27 ) Damage = 15.0; // SPAZ
    if( Weapon == 28 ) Damage = 7.0; // UZI
    if( Weapon == 29 ) Damage = 15.0; // MP5
    if( Weapon == 30 ) Damage = 20.0; // AK
    if( Weapon == 31 ) Damage = 15.0; // M4
    if( Weapon == 32 ) Damage = 10.0; // Tec9
    if( Weapon == 33 ) Damage = 50.0; // Country Rifle
    if( Weapon == 34 ) Damage = 300.0; // Sniper

    new Float:tArmour, Float:tHealth;
    GetPlayerArmour( Target , tArmour );
    GetPlayerHealth( Target , tHealth );
    //--->
    new Float:newColete;
    newColete = tArmour - Damage;
    if( newColete >= 0 ) SetPlayerArmour( Target , newColete );
    else
    {
        SetPlayerArmour( Target, 0.0 );
        //SetPlayerHealth( Target, newColete * (-1) );
        SetPlayerHealth( Target,  tHealth + newColete );
    }
    #if defined SHOOTSYSTEM_DEBUG
    new str[180];
    format( str , 180 , "[DEBUG] o ID %d atirou em no ID %d. Vida: %f para %f e Colete: %f para %f", Shooter, Target, HealthLost, vidaComDamageTirado, ArmourLost, coleteComDamageTirado );
    SendClientMessageToAll( -1 , str );
    format( str , 180 , "[DEBUG] Damage do Colete: %f. Da Vida: %f", Damage, (ArmourLost - coleteComDamageTirado) );
    SendClientMessageToAll( -1 , str );
    #endif
    return 1;
}
Reply
#4

@Luнs Miki
Nesse caso ele irб precizar da include OPSP.

#TOPIC

@Gabriel Duarte

Use esse FS: (Click aqui)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)