[Tutorial]Add Suicide Pill

Results 1 to 6 of 6
  1. #1
    Member Guigosoldadinho is offline
    MemberRank
    Oct 2014 Join Date
    52Posts

    [Tutorial]Add Suicide Pill




    Download: - Click Here -

    How to Install

    Copy the dowloaded files for your data.

    Open Warz_Server.sln

    Searc:
    Code:
    usedItemId==WeaponConfig::ITEMID_C01Vaccine||
    Add
    Code:
    usedItemId==WeaponConfig::ITEMID_SuicidePill|

    Like this
    Code:
    bool useOnOtherPlayer = usedItemId==WeaponConfig::ITEMID_Antibiotics||usedItemId==WeaponConfig::ITEMID_Bandages||usedItemId==WeaponConfig::ITEMID_Bandages2||usedItemId==WeaponConfig::ITEMID_CraftedBandages||
            usedItemId==WeaponConfig::ITEMID_Painkillers||usedItemId==WeaponConfig::ITEMID_ZombieRepellent||usedItemId==WeaponConfig::ITEMID_SuicidePill||usedItemId==WeaponConfig::ITEMID_C01Vaccine||usedItemId==WeaponConfig::ITEMID_AirHorn||
            usedItemId==WeaponConfig::ITEMID_C04Vaccine||usedItemId==WeaponConfig::ITEMID_Medkit;
    Search
    Code:
    case WeaponConfig::ITEMID_Lockbox:
                return UseItem_Lockbox(n.pos, n.var1, itemID);
                break;
    Add below
    Code:
    case WeaponConfig::ITEMID_SuicidePill:
        gServerLogic.DoKillPlayer(this, this, storecat_INVALID, false);
        break;
        return true;




    Search
    Code:
            ITEMID_Medkit = 101304,
    Add below
    Code:
            ITEMID_SuicidePill = 101102,

    Now open ItemsDB.xml

    Search
    Code:
    <Weapon itemID="101300" category="28" upgrade="1" FNAME="Consumables_PainKiller_01" Weight="100">
                <Model file="Data/ObjectsDepot/Weapons/Consumables_PainKiller_01.sco" AnimPrefix="" muzzlerOffset.x="0" muzzlerOffset.y="0" muzzlerOffset.z="0" />
                <MuzzleModel file="muzzle_asr" />
                <HudIcon file="$Data/Weapons/HudIcons/Consumables_PainKiller_01.dds" />
                <Store name="Pain killers" icon="$Data/Weapons/StoreIcons/Consumables_PainKiller_01.dds" desc="Over the counter pain killers that counter-act the effects of pain on the body." LevelRequired="1" />
                <PrimaryFire bullet="5.45" damage="20" immediate="true" mass="10" decay="50" speed="300" area="0" delay="0" timeout="0" numShells="1" clipSize="3" reloadTime="4" activeReloadTick="2" rateOfFire="10" spread="20" recoil="20" numgrenades="0" grenadename="asr_grenade" firemode="100" ScopeType="default" ScopeZoom="0" />
                <Animation type="assault" />
                <Sound shoot="" reload="" />
                <FPS IsFPS="1" i0="0" i1="0" i2="0" i3="0" i4="0" i5="0" i6="0" i7="0" i8="0" d0="0" d1="0" d2="0" d3="0" d4="0" d5="0" d6="0" d7="0" d8="0" />
            </Weapon>
    Add below
    Code:
    <Weapon itemID="101102" category="28" upgrade="1" FNAME="INB_Med_Suicide_01" Weight="0">
                <Model file="Data/ObjectsDepot/Weapons/INB_Med_Suicide_01.scb" AnimPrefix="" muzzlerOffset.x="0" muzzlerOffset.y="0" muzzlerOffset.z="0" />
                <MuzzleModel file="muzzle_asr" />
                <HudIcon file="$Data/Weapons/StoreIcons/INB_Med_Suicide_01.dds" />
                <Property hunger="0" thirst="0" stamina="0" health="-10000" bleeding="0" toxicity="0" infection="100" fever="0" poison="0" maxStackSize="5" cooldown="0" bpPrice="0" gsPrice="0" canCook="0" />
                <Store name="Suicide Pill" icon="$Data/Weapons/StoreIcons/INB_Med_Suicide_01.dds" desc="A spray on solution that when applied to the skin, it enters the blood stream and masks the smell of fresh blood." LevelRequired="0" />
                <PrimaryFire bullet="5.45" damage="20" immediate="true" mass="10" decay="50" speed="300" area="0" delay="0" timeout="0" numShells="1" clipSize="1" reloadTime="4" activeReloadTick="2" rateOfFire="10" spread="20" recoil="20" numgrenades="0" grenadename="asr_grenade" firemode="100" ScopeType="default" ScopeZoom="0" />
                <Animation type="assault" />
                <Sound shoot="" reload="" />
                <FPS />
            </Weapon>
    Open english.lang
    Add
    Code:
    101102_name=Suicide Pill
    101102_desc=For extreme cases!









    Last edited by Guigosoldadinho; 21-03-15 at 02:14 PM.


  2. #2
    Member fredaikis is offline
    MemberRank
    Nov 2013 Join Date
    65Posts

    Re: [Tutorial]Add Suicide Pill

    The idea is good, but you are forgeting something.
    Code:
    case WeaponConfig::ITEMID_SuicidePill:
        gServerLogic.DoKillPlayer(this, this, storecat_INVALID, false);
        break;
    You really should do a return there. Not very important, but just these little things that bug me :P
    PD: The dokillplayer function is a void, so just do return true; before the break.

  3. #3
    ☆Dying Dawn☆ Bombillo is offline
    MemberRank
    Jan 2012 Join Date
    ValhallaLocation
    977Posts

    Re: [Tutorial]Add Suicide Pill

    very nice! but when I drop the item I get Error

  4. #4
    Member Guigosoldadinho is offline
    MemberRank
    Oct 2014 Join Date
    52Posts

    Re: [Tutorial]Add Suicide Pill

    Quote Originally Posted by Bombillo View Post
    very nice! but when I drop the item I get Error
    What error?

  5. #5
    Valued Member asd4129 is offline
    MemberRank
    Dec 2012 Join Date
    Loose, Germany,Location
    146Posts

    Re: [Tutorial]Add Suicide Pill

    link is dead pls re-up

  6. #6
    DeadZone The Unknown is offline
    MemberRank
    Feb 2014 Join Date
    CanadaLocation
    442Posts

    Re: [Tutorial]Add Suicide Pill

    Haha, omg, whats the point of all that code? just add the item in ItemsDB as a consumbale (Food or drink)

    and edit

    <Property health="0"
    to a negative

    <Property health="-1000"
    And if you want the model files for this @asd4129, just extract the Aftermath data files, because that's where this is from.

    this



Advertisement