Jump to content
Sign in to follow this  
excruciator

Script question (if = then?)

Recommended Posts

I have made a little script

player switchmove "ActsPercMstpSnonWpstDnon_suicide1B";
sleep 3.9;
playsound "gunshot";
sleep 1.5;
player setdamage 1.0;

And in the init line of the player:

 (this addaction ["Suicide", "suicideani.sqf"];

This animates a suicide :D. When you use the action "suicide"

First question: I want this action only available when the person has an pistol in his gear, because it looks so stupid if you use this action without a pistol :p. Does somebody know how to do that?

Second question: I use player switchmove and player setdamage. Is there a way I can make it so all players can use the same script. Now I should make 10 scripts like these and call them player1, player2 etc. And that's pretty inconvenient.

I hope you guys/ girls know what I mean ;).

Thanks in Advance,

Share this post


Link to post
Share on other sites

First Answer:

this addaction ["Suicide", "suicideani.sqf",[],1,false,true,"","getNumber (configFile/'CfgWeapons'/(currentWeapon _this)/'type') == 2"];

Second Answer:

It's fine to use player since it'll only affect whoever triggered it.

Share this post


Link to post
Share on other sites

when i first tried this it worked fine except i was hearing the gunshot sound a full second before the animation showed the gun firing. So to fix this I decided to replace the sound with an m9 sound that I recorded and I added a full second of silence before the fire sound occurs. I saved it as ogg, added it to my description.ext and told the suicide script to use the new sound and then it worked perfect. The sound was then in sync with the animation. So then i made sure all 8 players in my 8 man coop mission all have m9 pistols only - and i made sure that there were no other pistols in the ammo crates other than m9's. later when i was testing my mission online with a friend we noticed that only the shooter/suicider can hear the new m9 sound that i added. meaning... my friend couldn't hear the shot when i suicided, but i could. and when he suicided i couldn't hear the shot, but he could.

Is there anyway to fix it so both of us can hear the shot fire?

also, i tried setting everything back the way it was originally setup using the default sound, but now i'm getting "Sound gunshot not found" when i test.

what i'd like to do is get it to work using my new sound, have it give the option on the menu to suicide when the pistol is selected, and have all players near by hear the shot when its fired. or get the default gunshot sound to stop giving me the message "Sound gunshot not found" and also play the gunshot in sync with the animation.

Edited by A-SUICIDAL

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  

×