IceEagle132 Posted September 19, 2016 Share Posted September 19, 2016 (edited) Difficulty: Easy Create Original Idea : Kuchiha Authors: AlaskaVet Okay in core/items make a new file called "fn_weed.sqf" /* Author:AlaskaVet */ //Close inventory closeDialog 0; //Little hint then wait a litle before starting drugs effects hint "Winners don't use drugs !"; sleep 3; //Activate ppEffects we need "chromAberration" ppEffectEnable true; "radialBlur" ppEffectEnable true; enableCamShake true; _smoke = "SmokeShellGreen" createVehicle position player; if (vehicle player != player) then { _smoke attachTo [vehicle player, [-0.6,-1,0]]; } else { _smoke attachTo [player, [0,-0.1,1.5]]; }; //Let's go for 45secs of effetcs for "_i" from 0 to 44 do { "chromAberration" ppEffectAdjust [random 0.25,random 0.25,true]; "chromAberration" ppEffectCommit 1; "radialBlur" ppEffectAdjust [random 0.02,random 0.02,0.15,0.15]; "radialBlur" ppEffectCommit 1; addcamShake[random 3, 1, random 3]; sleep 1; }; //Stop effects "chromAberration" ppEffectAdjust [0,0,true]; "chromAberration" ppEffectCommit 5; "radialBlur" ppEffectAdjust [0,0,0,0]; "radialBlur" ppEffectCommit 5; sleep 6; //Deactivate ppEffects "chromAberration" ppEffectEnable false; "radialBlur" ppEffectEnable false; resetCamShake; Now go Into core/pmenu & open "fn_useItem.sqf" Add under like lock picks like so: case (_item isEqualTo "lockpick"): { [] spawn life_fnc_lockpick; closeDialog 0; }; case (_item isEqualTo "marijuana"): { if(([false,_item,1] call life_fnc_handleInv)) then { [] spawn life_fnc_weed; }; }; Then Go into file "Functions.h" find "class Items" and add: class weed {}; Edited September 19, 2016 by AlaskaVet 4 Quote Link to comment Share on other sites More sharing options...
Jason_000 Posted September 20, 2016 Share Posted September 20, 2016 I mean this is hardly different from the original for you to change the author name 1 Quote Link to comment Share on other sites More sharing options...
buskape Posted October 10, 2016 Share Posted October 10, 2016 This is working great for my jamaican themed tanoa! Thanks! Quote Link to comment Share on other sites More sharing options...
JedINyte Posted October 17, 2016 Share Posted October 17, 2016 (edited) Why do you not add the smoke grenade to the pelvis (spawns inside you)? It won't float behind you. _smoke attachTo [player, [0,0,0],"Pelvis"]; Edited October 17, 2016 by JedINyte 1 Quote Link to comment Share on other sites More sharing options...
Hammo00 [RipperRP] Posted October 22, 2016 Share Posted October 22, 2016 On 17-10-2016 at 2:40 AM, JedINyte said: Why do you not add the smoke grenade to the pelvis (spawns inside you)? It won't float behind you. _smoke attachTo [player, [0,0,0],"Pelvis"]; does that exually work? Quote Link to comment Share on other sites More sharing options...
JedINyte Posted October 24, 2016 Share Posted October 24, 2016 On 10/22/2016 at 2:33 AM, Hammo00 [RipperRP] said: does that exually work? Yes mate that's how we did it on our server...it looks so much better than a floating smoke shell on/behind your back. 1 Quote Link to comment Share on other sites More sharing options...
keira78 Posted December 13, 2016 Share Posted December 13, 2016 My marijuana when processed its called Pot, do i need to change the name in the scrip or will it work anyways? im sry for the noob coment, but i aint that good with programming , im mostly good with Map Edition Quote Link to comment Share on other sites More sharing options...
Salkio | privatealpha.co.za Posted December 16, 2016 Share Posted December 16, 2016 works thank you Quote Link to comment Share on other sites More sharing options...
Franco Drambuie Posted January 22, 2017 Share Posted January 22, 2017 On 13/12/2016 at 5:31 AM, keira78 said: My marijuana when processed its called Pot, do i need to change the name in the scrip or will it work anyways? im sry for the noob coment, but i aint that good with programming , im mostly good with Map Edition did you get this to work? Quote Link to comment Share on other sites More sharing options...
Elite IV Posted January 22, 2017 Share Posted January 22, 2017 On 17/10/2016 at 10:40 AM, JedINyte said: Why do you not add the smoke grenade to the pelvis (spawns inside you)? It won't float behind you. _smoke attachTo [player, [0,0,0],"Pelvis"]; Fuck, that must suck getting a smoke grenade in your pelvis. #BISFunctions2k17 Quote Link to comment Share on other sites More sharing options...
Haduuken Posted January 22, 2017 Share Posted January 22, 2017 8 hours ago, Franco Drambuie said: did you get this to work? the script works I use it on my server the variable name is marijuana the display name that you see ingame is pot, you can change it in the stringtable.xml Quote Link to comment Share on other sites More sharing options...
Franco Drambuie Posted January 23, 2017 Share Posted January 23, 2017 @StonerGaming I am using v5.0 I cannot seem to use the pot...it does not reduce in my inventory. Tried a few changes in scripts..what V are you running? Quote Link to comment Share on other sites More sharing options...
Haduuken Posted January 23, 2017 Share Posted January 23, 2017 @Franco Drambuie I am using the same version, I have modified it for other drugs like heroin, never had an issue Quote Link to comment Share on other sites More sharing options...
Franco Drambuie Posted January 23, 2017 Share Posted January 23, 2017 Ok, probably something I missed. I will check it out in the morning... Quote Link to comment Share on other sites More sharing options...
Franco Drambuie Posted January 23, 2017 Share Posted January 23, 2017 @StonerGaming When you go into your vItems and select Pot and "use" does the number in your inventory decrease? Quote Link to comment Share on other sites More sharing options...
Haduuken Posted January 23, 2017 Share Posted January 23, 2017 Just now, Franco Drambuie said: @StonerGaming When you go into your vItems and select Pot and "use" does the number in your inventory decrease? yeah, I lose 1 marijuana everytime I smoke em Quote Link to comment Share on other sites More sharing options...
Franco Drambuie Posted January 23, 2017 Share Posted January 23, 2017 ok - Im going to give it a go in the next few minutes - making a backup first Quote Link to comment Share on other sites More sharing options...
Franco Drambuie Posted January 23, 2017 Share Posted January 23, 2017 I got it to work on v5.0 did not add the last ;} Quote Link to comment Share on other sites More sharing options...
suicidsasquatch Posted April 14, 2017 Share Posted April 14, 2017 (edited) how to add music nvm figured it out Edited April 14, 2017 by suicidsasquatch Quote Link to comment Share on other sites More sharing options...
winter Posted April 15, 2017 Share Posted April 15, 2017 Helllo im trying to make a custom usable item called "vape" however when i use the item it says its no usable any help would be nice! Quote Link to comment Share on other sites More sharing options...
GraveYard Posted April 15, 2017 Share Posted April 15, 2017 2 hours ago, winter said: Helllo im trying to make a custom usable item called "vape" however when i use the item it says its no usable any help would be nice! Did you add it inside "fn_useItem.sqf" case (_item isEqualTo "marijuana"): { [] spawn life_fnc_weed; closeDialog 0; }; Just change marijuana to the item you want to use then change life_fnc_weed to what file it needs to be life_fnc_vape or what ever. Quote Link to comment Share on other sites More sharing options...
winter Posted April 15, 2017 Share Posted April 15, 2017 (edited) 5 hours ago, AltisLifeCoder said: Did you add it inside "fn_useItem.sqf" case (_item isEqualTo "marijuana"): { [] spawn life_fnc_weed; closeDialog 0; }; Just change marijuana to the item you want to use then change life_fnc_weed to what file it needs to be life_fnc_vape or what ever. Made a mistake and put the variable name and not the class name. Edited April 15, 2017 by winter 2 Quote Link to comment Share on other sites More sharing options...
one Posted June 3, 2017 Share Posted June 3, 2017 On 4/14/2017 at 4:32 AM, suicidsasquatch said: how to add music nvm figured it out So what line did you add to get music to play? Quote Link to comment Share on other sites More sharing options...
one Posted June 4, 2017 Share Posted June 4, 2017 So heres what I did with this, see if you all like. Changed where the smoke comes out, thanks to @JedINyte Added a song when you are smoking. Really takes it over the top. In fn_weed.sqf /* Author:AlaskaVet */ //Close inventory closeDialog 0; //Little hint then wait a litle before starting drugs effects hint "Winners don't use drugs !"; sleep 3; //Activate ppEffects we need "chromAberration" ppEffectEnable true; "radialBlur" ppEffectEnable true; playSound "bong"; enableCamShake true; _smoke = "SmokeShellGreen" createVehicle position player; if (vehicle player != player) then { _smoke attachTo [vehicle player, [-0.6,-1,0]]; } else { _smoke attachTo [player, [0,0,0],"Pelvis"]; }; //Let's go for 45secs of effetcs for "_i" from 0 to 44 do { "chromAberration" ppEffectAdjust [random 0.25,random 0.25,true]; "chromAberration" ppEffectCommit 1; "radialBlur" ppEffectAdjust [random 0.02,random 0.02,0.15,0.15]; "radialBlur" ppEffectCommit 1; addcamShake[random 3, 1, random 3]; sleep 1; }; //Stop effects "chromAberration" ppEffectAdjust [0,0,true]; "chromAberration" ppEffectCommit 5; "radialBlur" ppEffectAdjust [0,0,0,0]; "radialBlur" ppEffectCommit 5; sleep 6; //Deactivate ppEffects "chromAberration" ppEffectEnable false; "radialBlur" ppEffectEnable false; resetCamShake; The playSound "bong"; tells the next step in the next file to play the .ogg file that you put in mission\sounds in mission\description.ext put this at the end of class CfgSounds class bong { name = "bong"; sound[] = {"\sounds\bong.ogg",2.0, 1}; titles[] = {}; }; Then go to your mission\sounds and place an .ogg sound file with the right name. I pieced the sound part together from the gas station robbery script. Please tell me if I am on the right track. It might have worked, but maybe there is a better way. Quote Link to comment Share on other sites More sharing options...
FabioSICasper Posted August 7, 2018 Share Posted August 7, 2018 tested and approved working fine in V 5.0 thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.