[Tutorial]Add Suicide Pill
https://www.youtube.com/watch?v=mus_AhzF9Fk
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!
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.
Re: [Tutorial]Add Suicide Pill
very nice! but when I drop the item I get Error
Re: [Tutorial]Add Suicide Pill
Quote:
Originally Posted by
Bombillo
very nice! but when I drop the item I get Error
What error?
Re: [Tutorial]Add Suicide Pill
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
Quote:
<Property health="0"
to a negative
Quote:
<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