Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
bluevein

Taser Mod Help

Recommended Posts

Hi all.

Ok nearly there with a taser we are making for City Life. But guess what it will kill you crazy_o.gif

Basically I'm looking for somone to help me finish it off so we can get it out to the ARMA community.

All the modeling is done, I just need help on the script and every one I have askes is too busy. (There must be someone out there)

Thanks in advanced:

taser1.jpg

config.CPP

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

{

class Taser

{

units[] = {};

weapons[] = {"Taser"};

};

};

class CfgVehicleClasses

{

class Recon_Weapons

{

displayName = "Recon Weapons";

};

};

class CfgSkeletons

{

class taserbones

{

isDiscrete = 0;

skeletonInherit = "";

skeletonBones[] = {};

};

};

class CfgModels {};

class CfgAmmo

{

class Default;

class Grenade;

class Mine;

class BulletCore;

class BulletBase;

class stuncharge: BulletBase

{

hit = 16;

indirectHit = 0;

indirectHitRange = 0;

model = "\ca\Weapons\shell";

cartridge = "FxCartridge_Small";

visibleFire = 0.01;

audibleFire = 0.01;

visibleFireTime = 1;

cost = 1;

deflecting = 10;

typicalSpeed = 350;

};

};

class CfgMagazines

{

class Default;

class CA_Magazine;

class recon_mag;

class Taser_Mag: recon_mag

{

scope = 2;

type = 16;

model = "\Taser\Taser_mag.p3d";

modelMagazine = "";

modelSpecial = "";

displayName = "Taser Battery";

picture = "\Taser\Icon\taser_m.paa";

ammo = "stuncharge";

nameSound = "";

count = 10;

initSpeed = 350;

reloadAction = "ManActReloadMagazine";

maxLeadSpeed = 23;

class Library

{

libTextDesc = "Deployment Charge x 10";

};

};

};

class CfgWeapons

{

class M9;

class Taser: M9

{

scope = 2;

model = "\Taser\Taser.p3d";

modelOptics = "-";

picture = "\Taser\icon\taser_w.paa";

displayName = "Taser";

sound[] = {"\Taser\sound\fire.ogg",1,1};

drySound[] = {"\Taser\sound\empty.ogg",1,1};

reloadMagazineSound[] = {"\Taser\sound\reload.ogg",1,1};

magazines[] = {"Taser_Mag"};

minRange = 2;

minRangeProbab = 0.1;

midRange = 30;

midRangeProbab = 0.8;

maxRange = 70;

maxRangeProbab = 0.04;

optics = 1;

distanceZoomMin = 50;

distanceZoomMax = 50;

dispersion = 0;

Dexterity = 3;

initSpeed = 365;

ffCount = 1;

aiRateOfFire = 0.35;

aiRateOfFireDistance = 50;

reloadTime = 0.1;

autoReload = 0;

opticsZoomMin = 0.32;

opticsZoomMax = 0.5;

magazineReloadTime = 2;

class EventHandlers

{

init = "[_this select 0] execVM ""\Taser\scripts\taser_init.sqf""";

};

class Library

{

libTextDesc = "";

};

};

};

taser_init.sqf:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_target_bullet = objNull;

_target = objNull;

_deadfirst = false;

taze = [player, _target];

publicVariable "taze";

_gunner = ( ( _this select 0 ) select 0 );

_type = ( ( _this select 0 ) select 4 );

while {isNull _target_bullet} do

{

_lista = _gunner nearObjects [ _type, 100 ];

if ( count _lista > 0 ) then

{

_target_bullet = _lista select 0;

};

Sleep 0.0001;

};

while {isNull _target} do

{

if ( ! isnull _target_bullet ) then{

_listb = _target_bullet nearObjects [ "man", 1.2 ];

if ( count _listb > 0 ) then

{

_target = _listb select 0;

};

};

Sleep 0.001;

};

if ( alive _target ) then

{

_deadfirst = false;

}else

{

_deadfirst = true;

};

sleep 0.05;

if ( _deadfirst ) exitwith

{

hint "Please don't tazer dead people, it's not nice";

};

if ( !_deadfirst ) then

{

_target playmove "AdthPercMstpSnonWnonDnon_3";

_target setmimic "surprised";

};

if ( player == _target ) then

{

hint format [ "You just got tasered by %1", ( name _gunner ) ];

};

if ( player == _gunner ) then

{

hint format [ "You have sucessfully tasered %1", ( name _target ) ];

};

if ( ( _target == _gunner ) && ( player == _gunner ) ) then

{

hint format [ "Well done %1, you tasered yourself :(", ( name _gunner ) ];

};

_i = 0;

_i2 = 0;

while {( _gunner distance _target ) > 5 || _i <= 40}do

{

if ( _i2 < 25 && ( player == _target ) ) then

{

titleText [ " ", "WHITE IN" ];

};

_target setdir ( getdir _target + 1 );

sleep 0.04;

if ( _i2 < 25 && ( player == _target ) ) then

{

titleText [ " ", "BLACK OUT" ];

};

_target setdir ( getdir _target - 1 );

_i = _i + 1;

_i2 = _i2 + 1;

sleep 0.025;

};

_i = 0;

_i2 = 0;

_num = ( random 3 ) + 3;

sleep _num;

if ( player == _target ) then

{

titleText [ " ", "BLACK IN" ];

};

_target switchmove "AidlPpneMstpSrasWrflDnon02";

_target setdammage ( getdammage _target + 0.15 );

sleep 1;

if ( alive _target ) then

{

_deadfirst = false;

}else

{

_deadfirst = true;

};

if ( !alive _target ) then

{

hint format [ "You killed %1 with your taser. It is meant to be used as a non lethal weapon only", name _target ];

};

if ( _deadfirst ) then

{

hint "Please don't tazer dead people, it's not nice";

};

Spooner helped in Ofpec but still I'm a bit wow_o.gif

Ofpec Post

Share this post


Link to post
Share on other sites
Quote[/b] ]class stuncharge: BulletBase

{

hit = 16;

indirectHit = 0;

indirectHitRange = 0;

model = "\ca\Weapons\shell";

cartridge = "FxCartridge_Small";

visibleFire = 0.01;

audibleFire = 0.01;

visibleFireTime = 1;

cost = 1;

deflecting = 10;

typicalSpeed = 350;

};

};

The bold part is whats killing people. Simply reduce that something less, such as 0 or 0.1 (as the script deals +0.15 on hit anyway, 0 would be fine I imagine).

Share this post


Link to post
Share on other sites

Is it possible to get something like this to work on AI?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×