Help a bit?
#1

I trying to make so weapons take more damnge but wont work

pawn Код:
}

stock DoDamage(playerid, targetid, bodypart, weaponid)
{
    static
        bodyparttext[16],
        string[68],
        DamageType,
        Float:IncreasedDamage,
        Float:health,
        Float:armour;
       
    GetPlayerHealth(targetid, health);
    GetPlayerArmour(targetid, armour);
    GetWeaponNameEx(weaponid, string, sizeof(string));
    switch(bodypart) {
        case 1: bodyparttext = "BODY_PART_HEAD",DamageType = 1;
        case 2: bodyparttext = "BODY_PART_TORSO",DamageType = 2;
        case 3: bodyparttext = "BODY_PART_LEGS",DamageType = 3; }
    switch(weaponid) {
        case 23: IncreasedDamage = SDPistolDMG; // SD Pistol
        case 24: IncreasedDamage = DeagleDMG; // Desert Eagle
        case 25: IncreasedDamage = ShotgunDMG; // Shotgun
        case 28: IncreasedDamage = UziDMG; // UZI
        case 30: IncreasedDamage = AK47DMG; // AK47
        case 31: IncreasedDamage = M4A1DMG; // M4A1
        case 32: IncreasedDamage = Tec9DMG; // Tec9
        case 33: IncreasedDamage = CountryRifleDMG; // Country Rifle
    }
    if(armour > 10) {
        if(DamageType == 1) { IncreasedDamage += 8.6; }
        else if(DamageType == 2) { IncreasedDamage += 6.6; }
        else if(DamageType == 3) { IncreasedDamage += 4.5; }
        SetPlayerArmour(targetid, armour-IncreasedDamage); }
    else if(health > 13) {
        if(DamageType == 1) { IncreasedDamage += 50.0; }
        else if(DamageType == 2) { IncreasedDamage += 50.0; }
        else if(DamageType == 3) { IncreasedDamage += 50.0; }
        SetPlayerHealth(targetid, health-IncreasedDamage); }
    if(health-IncreasedDamage == 0 || health-IncreasedDamage < 0) { Died[targetid] = 1; }
    return 1;
}
Reply
#2

How do you check where the player is aiming at?

You should use this include, I think https://sampforum.blast.hk/showthread.php?tid=195439.

And smth like this:

Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
 new Float:Health[2];
    GetPlayerHealth(Target, Health[0]);
    GetPlayerArmour(Target,Health[1]);
    if(GetPlayerWeapon(Shooter) == 24)
    {
        if(H[1] > 0) return SetPlayerArmour(Target,0);
        SetPlayerHealth(Target, H[0]-100);
    }
}
Hope that helps
Reply
#3

that include was made during 0.3a where OnPlayerGiveDamage was not make.
i recommend you to use OnPlayerGiveDamage. (since we are on 0.3e now)
Reply
#4

Oh, right, completely forgot about it. But the idea is same.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)