SlothWiiPlaza
Veteran
- Messages
- 34
- Reaction score
- 28
- Points
- 793
Hello, CabConModding,
Today i'm releasing my "Real" Forcefield script for Black Ops 2.
It's a pretty short code, it only changes a dvar so bye bye long "forcefield" code!
You can set it to the reccomended value or to a custom one, i've included both.
Ayways, here it is:
Today i'm releasing my "Real" Forcefield script for Black Ops 2.
It's a pretty short code, it only changes a dvar so bye bye long "forcefield" code!
You can set it to the reccomended value or to a custom one, i've included both.
Ayways, here it is:
Here's the code you would want:
PHP:
realForceField()
{
if(!isDefined(self.forceField))
{
self.forceField = "Active";
setDvar("playerPushAmount", "100");
iprintlnbold(self.name + ": Real Forcefield: [^2ON^7]");
}
else
{
self.forceField = undefined;
setDvar("playerPushAmount", "1");
iprintlnbold(self.name + ": Real Forcefield: [^1OFF^7]");
}
}
or if you want a custom input:
PHP:
realForceField(input)
{
if(!isDefined(self.forceField))
{
self.forceField = "Active";
setDvar("playerPushAmount", input);
iprintlnbold(self.name + ": Real Forcefield: [^2ON^7]");
}
else
{
self.forceField = undefined;
setDvar("playerPushAmount", "1");
iprintlnbold(self.name + ": Real Forcefield: [^1OFF^7]");
}
}
Call it in like:
PHP:
add_option(F, "Forcefield", ::realForceField);
PHP:
add_option(F, "Forcefield", ::realForceField, "50");
There, only 15 lines instead of 50 or so.
Now, personally i think my script is better because it's shorter and easier, like said before.
Happy Modding