hambeast Posted March 23, 2015 Author Report Share Posted March 23, 2015 just for shits and giggles, can you declare a clientside PVEH just to spit out some text? // Clientside PVEH (init this in your mission.pbo) if (!isDedicated) then { // expects [] "PVEH_PlaySoundClient" addPublicVariableEventHandler { systemChat "We got our PVEH"; }; }; try placing that in your init.sqf along with your server side one. maybe declare this one first. computermancer 1 Link to comment Share on other sites More sharing options...
computermancer Posted March 23, 2015 Report Share Posted March 23, 2015 I'm shittin', and I'm gigglin'!! :wub: The PVEH message shows up on my screen as well as the other player who is withing 30m, outside that, the message doesn't show. :D How should I execute the sound? Wouldit just be player playsound "soudname"; :blink: Link to comment Share on other sites More sharing options...
hambeast Posted March 24, 2015 Author Report Share Posted March 24, 2015 that... is beyond my expertise. I'm just a simple PVEH coder lol. You could try the playsound command but... I've never messed with it. Link to comment Share on other sites More sharing options...
hambeast Posted March 24, 2015 Author Report Share Posted March 24, 2015 Just saw this... IDK if this will be helpful for you but it seems to incorporate the distance in the parameters: https://community.bistudio.com/wiki/playSound3D edit: might not even need a PVEH Link to comment Share on other sites More sharing options...
computermancer Posted March 24, 2015 Report Share Posted March 24, 2015 I think I got it.... I noticed 2 lightning bolts, I fixed that alread ;) [/youtbe] Link to comment Share on other sites More sharing options...
hambeast Posted March 25, 2015 Author Report Share Posted March 25, 2015 oh man that is awesome! Glad to see you got it working Link to comment Share on other sites More sharing options...
computermancer Posted March 25, 2015 Report Share Posted March 25, 2015 Yeah, thanks for your help in understanding PVEH, making the server do stuff for me was a big weakness of mine in my scripting arsenal. :ph34r: hambeast 1 Link to comment Share on other sites More sharing options...
RimBlock Posted March 25, 2015 Report Share Posted March 25, 2015 Late to the party as usual but just a couple of suggestions on the code. In the _playersToSend loop, count is faster than forEach if you don't need to use the _forEachIndex special variable in the loop code. nearentities is also faster than nearestObjects. if (isPlayer _x) then {}; will detect if the player is a human player. Hope this helps. computermancer and hambeast 2 Link to comment Share on other sites More sharing options...
computermancer Posted March 26, 2015 Report Share Posted March 26, 2015 Doesn't count only give a number, where as foreach allows code to be run on each? Link to comment Share on other sites More sharing options...
RimBlock Posted March 26, 2015 Report Share Posted March 26, 2015 Doesn't count only give a number, where as foreach allows code to be run on each? Nope. Both iterate through an array and use _x as the current array element inside the loop. forEach allows a second special variable called _forEachIndex which contains the index of the current array element in the loop. Count does not have this special vairiable but runs faster. If you do not use this second special variable then they are both interchangable. computermancer 1 Link to comment Share on other sites More sharing options...
computermancer Posted March 26, 2015 Report Share Posted March 26, 2015 So count does the same thing as forEach, minus the second part (the index)? And this would work for what I am doing which is just checking if they are a player, and then running some code? BTW: Thanks for the advice, I am sure I have A TON of wasteful code! :rolleyes: Link to comment Share on other sites More sharing options...
T.LEE Posted February 4, 2016 Report Share Posted February 4, 2016 del Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now