OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Nobby on 11 Oct 2002, 13:27:50
-
Howz these apples?
I want to have a guy that can have two handguns, not 2 different handguns but the silenced version and unsilenced version of a gun.
Then in the ACTION menu I want to have the option to "ADD SILENCER" and "REMOVE SILENCER". So it's just the same gun but with a silencer and without a silencer, perfect for a mission where you have to use stealth until the alarm is raised, and then stealth dunt really matter.
Saw a Radio script once upon a time that meant a soldier could carry both a M16 and a sniper rifle but I can't find it.
Any help would be greatly appreiciated.
Cheers
Nobby
-
Let's take an example with a beretta and a glock.
Allrite, here we go:
________________________
name your man 'aP' or something like it, because I am going to referr to aP later on.
twopistols1.sqs this should be activated with a radio Alpha, activation: repeatedly and have the name "Change to Glock"
and have the activation field say [] exec "twopistols1.sqs
---------------------
RemoveAllWeapons aP
aP AddWeapon "Glock"
aP AddMagazine "GlockMag"
aP AddMagazine "GlockMag"
aP AddMagazine "GlockMag"
aP AddMagazine "GlockMag"
exit
---------------------
twoweapons2.sqs this should have activation radio Bravo, repeatedly, name "Change to Beretta". on activation: [] exec "twoweapons2.sqs"
------------------------
RemoveAllWeapons aP
aP AddWeapon "Beretta"
aP AddMagazine "BerettaMag"
aP AddMagazine "BerettaMag"
aP AddMagazine "BerettaMag"
aP AddMagazine "BerettaMag"
exit
----------------------------
this concludes my scripting thingy... if this don't work, dont yell at me, since I just tried to help :)
-
Smashing mate, just tried it and it works a treat.
Cheers
Nobby
-
I've just suggested basically the same thing on the other thread ..... minor point, this script effectively gives you infinite ammo. I think there is a command for counting magazines, not sure, but if there is you might want to add it in.
-
;D :D :D ;D :) :D :) :beat: :beat: :thumbsup: :toocool:
good to be of help.. havent been for a heck of a lot of time...
Indeed. But i am not the most advanced scripter... If I had the skill, I would make a script that only allowed you to change guns and dont get more ammo than you had.. so you dont get more ammo..
-
There are two solutions for the infinite ammo problem:
You can count magazines each time you change weapons. But you could still cheat by shooting until there is one bullet left and then change weapons. You would then have a fully loaded magazine.
The second (and more elegant) solution requires that you also can do addons. If you would have the silenced and the unsilenced version of the same pistiol that uses the same magazine, you would only have to switch the weapon, not the magazines. That would solve all ammo problems and would be rather easy. There will be a silenced Glock with resistance patch 1.85. I don't know if it will use the same magazines as the unsilenced one but if it does, you wouldn't have to create any addons. If it doesn't, you'll have to do exactly that.