Lucifer

Veteran
Messages
770
Reaction score
499
Points
878
Hello, this will be continue when the Mod Tools are available. You will find here anything you need to develop a Bo3 Mod.


Multiplayer
Please, Log in or Register to view URLs content!

UPDATE Weapon List
Please, Log in or Register to view URLs content!

Please, Log in or Register to view URLs content!

Please, Log in or Register to view URLs content!

Please, Log in or Register to view URLs content!

Please, Log in or Register to view URLs content!

Please, Log in or Register to view URLs content!

Please, Log in or Register to view URLs content!



Zombie
Please, Log in or Register to view URLs content!

Please, Log in or Register to view URLs content!

Please, Log in or Register to view URLs content!

Please, Log in or Register to view URLs content!

Please, Log in or Register to view URLs content!

God Mode
PHP:
function func_godmode()
{
    if(!isDefined(self.gamevars["godmode"]))
    {
        self.gamevars["godmode"] = true;
        self enableInvulnerability();
        self iprintln("God Mode ^2ON");
    }
    else
    {
        self.gamevars["godmode"] = undefined;
        self disableInvulnerability();
        self iprintln("God Mode ^1OFF");
    }
}

Unlimited Ammo
PHP:
function func_unlimitedAmmo()
{
    if(!isDefined(self.gamevars["ammo_weap"]))
    {
        self notify("stop_ammo");
        self thread func_ammo();
        S("Unlimited Ammo ^2ON");
        self.gamevars["ammo_weap"] = true;
    }
    else
    {
        self notify("stop_ammo");
        self.gamevars["ammo_weap"] = undefined;
        S("Unlimited Ammo ^1OFF");
    }
}

function func_ammo()
{
    self endon("stop_ammo");
    for(;;)
    {
            if(self.gamevars["ammo_weap"]==true)
            {
                if ( self getcurrentweapon() != "none" )
                {
                    self setweaponammostock( self getcurrentweapon(), 1337 );
                    self setweaponammoclip( self getcurrentweapon(), 1337 );
                }
            }
        wait .1;
    }
}

Ufo Mode
PHP:
function func_ufomode()
{
    if(!isDefined(self.gamevars["ufomode"]))
    {
        self thread func_activeUfo();
        self.gamevars["ufomode"] = true;
        self iPrintln("UFO Mode ^2ON");
        self iPrintln("Press [{+frag}] To Fly");
    }
    else
    {
        self notify("func_ufomode_stop");
        self.gamevars["ufomode"] = undefined;
        self iPrintln("UFO Mode ^1OFF");
    }
}
function func_activeUfo()
{
    self endon("func_ufomode_stop");
    self.Fly = 0;
    UFO = spawn("script_model",self.origin);
    for(;;)
    {
        if(self FragButtonPressed())
        {
            self playerLinkTo(UFO);
            self.Fly = 1;
        }
        else
        {
            self unlink();
            self.Fly = 0;
        }
        if(self.Fly == 1)
        {
            Fly = self.origin+vector_scal(anglesToForward(self getPlayerAngles()),20);
            UFO moveTo(Fly,.01);
        }
        wait .001;
    }
}

function vector_scal(vec, scale)
{
    vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
    return vec;
}

Third Person
PHP:
function func_thirdPerson()
{
    if(!isDefined(self.gamevars["thirdPerson"]))
    {
        self SetClientThirdPerson( 1 );
        self SetClientThirdPersonAngle( 354 );
        self setDepthOfField( 0, 128, 512, 4000, 6, 1.8 );
        self.gamevars["thirdPerson"] = true;
    }
    else
    {
        self SetClientThirdPerson( 0 );
        self SetClientThirdPersonAngle( 0 );
        self setDepthOfField( 0, 0, 512, 4000, 4, 0 );
        self.gamevars["thirdPerson"] = undefined;
    }
    self resetFov();
}

Magicbullet
PHP:
//example: func_magicbullettest("launcher_standard");
function func_magicbullettest(i)
{
    if(!isDefined(self.gamevars["magicbullet"]) || self.gamevars["magicbullet"] == false)
    {
        self.gamevars["magicbullet"] = true;
        self iprintln("Magic Bullets ^2ON");
        while(self.gamevars["magicbullet"])
        {
            self waittill( "weapon_fired" );
            if(self.gamevars["magicbullet"] == false)
                continue;
            MagicBullet( GetWeapon( i ), self GetEye(), BulletTrace(self GetEye(), self GetEye() + AnglesToForward(self GetPlayerAngles()) * 100000, false, self)["position"], self);
            wait .025;
        }
    }
    else
    {
        self.gamevars["magicbullet"] = false;
        self iprintln("Magic Bullets ^1OFF");
    }
}
List of inputs:
Code:
remote_missile_bomblet
flak_drone_rocket
remote_missile_missile
straferun_rockets
launcher_standard
minigun

Give Random Weapon
Put this into the #using list:
Code:
#using scripts\shared\weapons_shared;
#using scripts\shared\array_shared;

Add this function somewhere:
Code:
function func_giveRandomWeapon()
{
    weaponsList_array = strTok("pistol_standard ar_standard sniper_fastbolt sniper_powerbolt ar_marksman lmg_heavy "," "); // fill this with random weapons from the game, I tried to search a array whichs stores all weapons from the game but I didn't find one!
    for(;;)
    {
        weaponPick = array::random(weaponsList_array);
        weaponPick = getWeapon(weaponPick);
        if( self hasWeapon( weaponPick ) )
            continue;
        else if ( weapons::is_primary_weapon( weaponPick ) )
            break;
        else if ( weapons::is_side_arm( weaponPick ) )
            break;
        else
            continue;
    }
    self iprintln(weaponPick.displayName);
    self iprintln(weaponPick.name);
    self TakeWeapon(self GetCurrentWeapon());
    self giveWeapon(weaponPick);
    self GiveMaxAmmo(weaponPick);
    self SwitchToWeapon(weaponPick);
}

You can call now ::func_giveRandomWeapon and you will get one weapon of the weaponsList_array array! :grinning:

Change classes
Code:
#using scripts\mp\gametypes\_globallogic_ui;
#using scripts\mp\gametypes\_loadout;

function changeClass()
{
        self endon("disconnect");
        self endon("death");
    
        self globallogic_ui::beginClassChoice();
        for(;;)
        {
                if(self.pers["changed_class"])
                        self loadout::giveLoadout(self.team, self.class);
                wait 0.05;
        }
}

hintMessage on every player in the lobby
PHP:
#using scripts\shared\hud_message_shared;

function TW(message)
{
    foreach(player in level.players)
    player hud_message::hintMessage(message);
}
//example: TW("^2Hello everyone!");

Hide Weapon
Code:
function func_togglehideWeapon()
{
    if(getDvarint("cg_drawGun") == 0)
       setDvar("cg_drawGun", "1");
    else
       setDvar("cg_drawGun", "0");
    self iprintln("Hide Gun " + ((getDvarint("cg_drawGun") == 0) ? "^2ON" : "^1OFF"));
}

Print Origin
Code:
function func_getOrigin()
{
    self IPrintLn("Your Origin ^2"+self GetOrigin());
}

Invisible
Code:
function func_invisible()
{
    if(!self.gamevars["invisible"] || !isDefined(self.gamevars["invisible"]))
    {
        self hide();
        self.gamevars["invisible"] = true;
        self IPrintLn("You are ^2Invisible");
    }
    else
    {
        self show();
        self.gamevars["invisible"] = false;
        self IPrintLn("You are ^1Visible");
    }
}

Zombie Give Perk
Code:
#using scripts\zm\_zm_perks;

function func_doGivePerk(perk)
{
    if (!(self hasperk(perk) || self zm_perks::has_perk_paused(perk)))
    {
        self zm_perks::vending_trigger_post_think( self, perk );
    }
    else
    {
        self notify(perk + "_stop");
        self iprintln("Perk [" + perk + "] ^1Removed");
    }
}

Credits
CabCon
CraigChrist8239
xTwinkyModz
This is very nice Cabcon good job :smile:
 

Aspire

Known Member
Messages
31
Reaction score
14
Points
118
also i tested the Teleporter and it doesn´t work. Please fix, because i don´t find the probkem in the code.
Code:
//might need to get fixed

#using scripts\shared\util_shared;

self setOrigin(&locationSelector); //use it like this

function locationSelector()
{
    self endon("disconnect");
    self endon("death");

    self BeginLocationSelection("map_mortar_selector");
    self DisableOffhandWeapons();
    self GiveWeapon("killstreak_remote_turret_mp", 0, false); // or planemortar
    self SwitchToWeapon("killstreak_remote_turret_mp"); //killstreak_remote_turret_mp was bo2's and it exists in bo3 again so I'm not sure
    self.selectingLocation = 1;
    self waittill("confirm_location", location);
    newLocation = BulletTrace(location+( 0, 0, 100000 ), location, false, self)["position"];
    self EndLocationSelection();
    self EnableOffhandWeapons();
    self SwitchToWeapon(self util::getlastweapon());
    self.selectingLocation = undefined;
    return newLocation;
}
Copied from above
Forget that code's a wreck lol give me some time and I'll work on it
 
Last edited:

TwinightCow

Veteran
Messages
21
Reaction score
8
Points
783

From 2 weeks ago.. And even then I had it for about a week
U mean youve had the script for 2 weeks? ok, I was the first one to publicly release it. I found it myself and thought "Hey, why not let others have it who dont." Not trying to be "the original" Just tryin to help those who dont know how to make their own scripts
 

ProSuchtiHD

Known Member
Messages
13
Reaction score
9
Points
108
What is this?
hardpointType
It is used for Killstreaks and I don´t know what to write for this variable.
 

ProSuchtiHD

Known Member
Messages
13
Reaction score
9
Points
108
This is my own small Mod Menu on the Base of CabCon!
The editable code is in the download file in the video description!
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,121
Reaction score
2,886
Points
1,103
also i tested the Teleporter and it doesn´t work. Please fix, because i don´t find the probkem in the code.
Code:
//might need to get fixed

#using scripts\shared\util_shared;

self setOrigin(&locationSelector); //use it like this

function locationSelector()
{
    self endon("disconnect");
    self endon("death");

    self BeginLocationSelection("map_mortar_selector");
    self DisableOffhandWeapons();
    self GiveWeapon("killstreak_remote_turret_mp", 0, false); // or planemortar
    self SwitchToWeapon("killstreak_remote_turret_mp"); //killstreak_remote_turret_mp was bo2's and it exists in bo3 again so I'm not sure
    self.selectingLocation = 1;
    self waittill("confirm_location", location);
    newLocation = BulletTrace(location+( 0, 0, 100000 ), location, false, self)["position"];
    self EndLocationSelection();
    self EnableOffhandWeapons();
    self SwitchToWeapon(self util::getlastweapon());
    self.selectingLocation = undefined;
    return newLocation;
}
Copied from above
I also have problems with this code, I started to code a completely new BO3 Teleport function:
Code:
//includes:
#using scripts\mp\killstreaks\_airsupport;
#precache( "locationselector", "compass_objpoint_helicopter" );

//Function
function func_teleportWithSelector(player)
{
    self beginLocationComlinkSelection( "compass_objpoint_helicopter", 1500 );
    self.selectingLocation = true;

    self thread airsupport::endSelectionThink();

    location = self func_waittill_confirm_location();

    if ( !isdefined( location ) )
    {
        return false;
    }

    player SetOrigin( location );
    self endLocationSelection();
    self.selectingLocation = undefined;
    
    self iprintln("You teleported ^2"+player.name);
}
function func_waittill_confirm_location()
{
    self endon( "emp_jammed" );
    self endon( "emp_grenaded" );

    self waittill( "confirm_location", location );
    
    return location;
}
I also do not get the function fully working. The selector map don't display to me.... :confused:
 

Sergiosvdev

Modder
Messages
8
Reaction score
14
Points
213
I also have problems with this code, I started to code a completely new BO3 Teleport function:
Code:
//includes:
#using scripts\mp\killstreaks\_airsupport;
#precache( "locationselector", "compass_objpoint_helicopter" );

//Function
function func_teleportWithSelector(player)
{
    self beginLocationComlinkSelection( "compass_objpoint_helicopter", 1500 );
    self.selectingLocation = true;

    self thread airsupport::endSelectionThink();

    location = self func_waittill_confirm_location();

    if ( !isdefined( location ) )
    {
        return false;
    }

    player SetOrigin( location );
    self endLocationSelection();
    self.selectingLocation = undefined;
 
    self iprintln("You teleported ^2"+player.name);
}
function func_waittill_confirm_location()
{
    self endon( "emp_jammed" );
    self endon( "emp_grenaded" );

    self waittill( "confirm_location", location );
 
    return location;
}
I also do not get the function fully working. The selector map don't display to me.... :confused:

There is a small difference between BO2 and BO3, in BO2 you can use the map_mortar_selector without giving
killstreak_remote_turret_mp. However, in BO3 you must give that weapon because it is where the map is displayed.

Code:
function location_selector() {

    currentWeapon = self GetCurrentWeapon();
    self beginLocationSelection("map_mortar_selector");
    self DisableOffhandWeapons();
    pad = GetWeapon("killstreak_remote_turret");
    self GiveWeapon(pad);
    self SwitchToWeapon(pad);
    self.selectingLocation = 1;
    self waittill("confirm_location", location);
    newLocation = BulletTrace(location + (0, 0, 100000), location, false, self)["position"];
    self EndLocationSelection();
    self EnableOffhandWeapons();
    self SwitchToWeapon(currentWeapon);
    self.selectingLocation = undefined;

    return newLocation;
}

function teleport()
{
    location = location_selector();
    self SetOrigin(location);
}

Proof:
3oriO4XyAW0eu1LFJu.gif
 
Last edited:

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,121
Reaction score
2,886
Points
1,103
There is a small difference between BO2 and BO3, in BO2 you can use the map_mortar_selector without giving
killstreak_remote_turret_mp. However, in BO3 you must give that weapon because it is where the map is displayed.

Code:
function location_selector() {

    currentWeapon = self GetCurrentWeapon();
    self beginLocationSelection("map_mortar_selector");
    self DisableOffhandWeapons();
    pad = GetWeapon("killstreak_remote_turret");
    self GiveWeapon(pad);
    self SwitchToWeapon(pad);
    self.selectingLocation = 1;
    self waittill("confirm_location", location);
    newLocation = BulletTrace(location + (0, 0, 100000), location, false, self)["position"];
    self EndLocationSelection();
    self EnableOffhandWeapons();
    self SwitchToWeapon(currentWeapon);
    self.selectingLocation = undefined;

    return newLocation;
}

function teleport()
{
    location = location_selector();
    self SetOrigin(location);
}

Proof:
3oriO4XyAW0eu1LFJu.gif
Thank you very much! :y: You're right, I forgot to give the weapon.
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,121
Reaction score
2,886
Points
1,103
There is a small difference between BO2 and BO3, in BO2 you can use the map_mortar_selector without giving
killstreak_remote_turret_mp. However, in BO3 you must give that weapon because it is where the map is displayed.

Code:
function location_selector() {

    currentWeapon = self GetCurrentWeapon();
    self beginLocationSelection("map_mortar_selector");
    self DisableOffhandWeapons();
    pad = GetWeapon("killstreak_remote_turret");
    self GiveWeapon(pad);
    self SwitchToWeapon(pad);
    self.selectingLocation = 1;
    self waittill("confirm_location", location);
    newLocation = BulletTrace(location + (0, 0, 100000), location, false, self)["position"];
    self EndLocationSelection();
    self EnableOffhandWeapons();
    self SwitchToWeapon(currentWeapon);
    self.selectingLocation = undefined;

    return newLocation;
}

function teleport()
{
    location = location_selector();
    self SetOrigin(location);
}

Proof:
3oriO4XyAW0eu1LFJu.gif
Also @Sergiosvdev, I'm currently trying to find out how the bots system work.
Code:
//includes:
#using scripts\shared\bots\_bot;

//functions
function func_addBot(count)
{
    bot::add_bots(count);
    self IPrintLn("You added ^2"+count+"^7 Bots");
}

function func_kickBot(count)
{
    bot::remove_bots(count);
    self IPrintLn("You removed ^2"+count+"^7 Bots");
}
function func_killBots()
{
    players = GetPlayers();

    foreach( player in players )
    {
        if ( !player IsTestClient() )
        {
            continue;
        }

        player bot::kill_bot();
        
    }
}

When I use &func_kickBot from the game, it will work with the first bot. When one got kicked and I do it again the game will crash with connection lost. :smile: Do you know where the problem is? I searched in the game files, can not find a problem with the function... :confused: Maybe is there a notify missing or something like that.

Also from where did you learned to develope? :smile: I never heard your name before in the modding community.
 

ProSuchtiHD

Known Member
Messages
13
Reaction score
9
Points
108
Also @Sergiosvdev, I'm currently trying to find out how the bots system work.
Code:
//includes:
#using scripts\shared\bots\_bot;

//functions
function func_addBot(count)
{
    bot::add_bots(count);
    self IPrintLn("You added ^2"+count+"^7 Bots");
}

function func_kickBot(count)
{
    bot::remove_bots(count);
    self IPrintLn("You removed ^2"+count+"^7 Bots");
}
function func_killBots()
{
    players = GetPlayers();

    foreach( player in players )
    {
        if ( !player IsTestClient() )
        {
            continue;
        }

        player bot::kill_bot();
       
    }
}

When I use &func_kickBot from the game, it will work with the first bot. When one got kicked and I do it again the game will crash with connection lost. :grinning: Do you know where the problem is? I searched in the game files, can not find a problem with the function... :confused: Maybe is there a notify missing or something like that.

Also from where did you learned to develope? :grinning: I never heard your name before in the modding community.
I will test it in a few minutes.
 

ProSuchtiHD

Known Member
Messages
13
Reaction score
9
Points
108
Code:
function remove_bots( count, team )
{
    players = GetPlayers();

    foreach( player in players )
    {
        if ( !player IsTestClient() )
        {
            continue;
        }
       
        if ( isdefined( team ) && player.team != team )
        {
            continue;
        }

        remove_bot( player );
       
        if ( isdefined( count ) )
        {
            count--;
            if ( count <= 0 )
            {
                break;
            }
        }
    }
}

function remove_bot( bot )
{
    if ( !bot IsTestClient() )
    {
        return;
    }
   
    bot [[level.onBotRemove]]();
       
    bot BotDropClient();
}
This are the functions from the _bot.gsc file in bo3.
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,121
Reaction score
2,886
Points
1,103
Code:
function remove_bots( count, team )
{
    players = GetPlayers();

    foreach( player in players )
    {
        if ( !player IsTestClient() )
        {
            continue;
        }
      
        if ( isdefined( team ) && player.team != team )
        {
            continue;
        }

        remove_bot( player );
      
        if ( isdefined( count ) )
        {
            count--;
            if ( count <= 0 )
            {
                break;
            }
        }
    }
}

function remove_bot( bot )
{
    if ( !bot IsTestClient() )
    {
        return;
    }
  
    bot [[level.onBotRemove]]();
      
    bot BotDropClient();
}
This are the functions from the _bot.gsc file in bo3.
Yes, I know the function and it is not working... like I said.
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,121
Reaction score
2,886
Points
1,103
@Sergiosvdev Thank you I was able to fix my function, I will give credits to you!

Teleport Function

void <player> func_teleportWithSelector(<client>)
Example
self func_teleportWithSelector(getPlayers[0]);

Code:
//includes:
#using scripts\mp\killstreaks\_airsupport;
#precache( "locationselector", "compass_objpoint_helicopter" );

//Function
function func_teleportWithSelector(player)
{
    currentWeapon = self GetCurrentWeapon();
    self beginLocationSelection("map_mortar_selector");
  
    self DisableOffhandWeapons();
    self GiveWeapon(GetWeapon("killstreak_remote_turret"));
    self SwitchToWeapon(GetWeapon("killstreak_remote_turret"));

    self.selectingLocation = true;
    location = self func_waittill_confirm_location();

    if ( !isdefined( location ) )
    {
        self IPrintLn("^1Not able to get any origin!");
        return false;
    }

    player SetOrigin( location );
    self EndLocationSelection();
    self EnableOffhandWeapons();
    self SwitchToWeapon(currentWeapon);
    self.selectingLocation = undefined;

    self iprintln("You teleported ^2"+player.name);
}
function func_waittill_confirm_location()
{
    self endon( "emp_jammed" );
    self endon( "emp_grenaded" );

    self waittill( "confirm_location", location );
  
    return location;
}

Credits
@CabCon
@Sergiosvdev
 

Sergiosvdev

Modder
Messages
8
Reaction score
14
Points
213
Also @Sergiosvdev, I'm currently trying to find out how the bots system work.
Code:
//includes:
#using scripts\shared\bots\_bot;

//functions
function func_addBot(count)
{
    bot::add_bots(count);
    self IPrintLn("You added ^2"+count+"^7 Bots");
}

function func_kickBot(count)
{
    bot::remove_bots(count);
    self IPrintLn("You removed ^2"+count+"^7 Bots");
}
function func_killBots()
{
    players = GetPlayers();

    foreach( player in players )
    {
        if ( !player IsTestClient() )
        {
            continue;
        }

        player bot::kill_bot();
    
    }
}

When I use &func_kickBot from the game, it will work with the first bot. When one got kicked and I do it again the game will crash with connection lost. :grinning: Do you know where the problem is? I searched in the game files, can not find a problem with the function... :confused: Maybe is there a notify missing or something like that.

Also from where did you learned to develope? :grinning: I never heard your name before in the modding community.

Another option you have is kick the bot as a normal player checking first if it is a bot.
It Semi-works because once kicked, Bots reconnect again.

Code:
function removeBots(count)
{
    currBots = 0;
    foreach(player in level.players)
    {
        if(currBots < count)
        {
            if(isDefined (player.pers["isBot"]) && player.pers["isBot"])
            {
                kick(player getEntityNumber());
                currBots ++;
            }
        }
    }
    IPrintLn(count + " ^2Bots were removed!");
}

Screenshot.png


Alternatively you can call this function on a loop so they are kicked every time they enter to the lobby.
This is not a good solution, im going to try to find another way.
 
Last edited by a moderator:

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,121
Reaction score
2,886
Points
1,103
Alternatively you can call this function on a loop so they are kicked every time they enter to the lobby.
This is not a good solution, im going to try to find another way.
Yes, that's right. I will also try to find a solution! :smile:
 

MTNZ

Veteran
Messages
2
Reaction score
2
Points
778
Teleport Gun
Code:
function ToggleTeleportGun()
{
    if (self.TPG == true)
    {
        self thread TeleportGun();
        self iPrintln("^7Teleport Gun: ^2ON");
        self.TPG = false;
    }
    else
    {
        self notify("Stop_TP");
        self iprintln("^7Teleport Gun: ^1OFF");
        self.TPG = true;
    }
}

function TeleportGun()
{
    self endon( "disconnect" );
    self endon("Stop_TP");
    for(;;)
    {
    self waittill("weapon_fired");
    self setorigin(bullettrace(self gettagorigin("j_head"), self gettagorigin("j_head") + anglesToForward(self getplayerangles()) * 1000000, 0, self)["position"]);
    }
}
 
Last edited by a moderator:

Cxwh

Veteran
Messages
64
Reaction score
45
Points
793
Alternatively you can call this function on a loop so they are kicked every time they enter to the lobby.
This is not a good solution, im going to try to find another way.
Does banning help?

Code:
function removeBots(count)
{
    currBots = 0;
    foreach(player in level.players)
    {
        if(currBots < count)
        {
            if(isDefined(player.pers["isBot"]) && player.pers["isBot"])
            {
                ban(player getEntityNumber());
                kick(player getEntityNumber());
                currBots ++;
            }
        }
    }
    IPrintLn(count + " ^2Bots were removed!");
}
 
Top