CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,998
Reaction score
2,918
Points
1,053
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!");
}
Maybe did you test the code? :smile:
 

Cxwh

Veteran
Messages
64
Reaction score
45
Points
793
There's already one
Code:
entity <actor> DropWeapon(<weapon name>,<hand>,[velocity],[angular velocity],[scavenger])
[MANDATORY] <weapon name> (string) The name of the weapon
[MANDATORY] <hand> (string) The tag to throw the weapon from
[OPTIONAL] [velocity] (vector) The initial velocity of the weapon
[OPTIONAL] [angular velocity] (vector) The initial angular velocity of the weapon
[OPTIONAL] [scavenger] (bool) If the weapon requires the player to have scavenger perk to pick up the weapon
CATEGORY: AI
CLIENT/SERVER: Server
SUMMARY: Drop the actor's weapon
EXAMPLE: self DropWeapon(self.weapon, self.anim_gunHand, throwVel)
 

CoD_Modern_Gamer

Insane-Known Member
Messages
44
Reaction score
15
Points
368
There's already one
Code:
entity <actor> DropWeapon(<weapon name>,<hand>,[velocity],[angular velocity],[scavenger])
[MANDATORY] <weapon name> (string) The name of the weapon
[MANDATORY] <hand> (string) The tag to throw the weapon from
[OPTIONAL] [velocity] (vector) The initial velocity of the weapon
[OPTIONAL] [angular velocity] (vector) The initial angular velocity of the weapon
[OPTIONAL] [scavenger] (bool) If the weapon requires the player to have scavenger perk to pick up the weapon
CATEGORY: AI
CLIENT/SERVER: Server
SUMMARY: Drop the actor's weapon
EXAMPLE: self DropWeapon(self.weapon, self.anim_gunHand, throwVel)

*facepalm* that was a little too complicated :/
Is there a finished one like the ones I saw on top?
 

Cxwh

Veteran
Messages
64
Reaction score
45
Points
793
*facepalm* that was a little too complicated :/
Is there a finished one like the ones I saw on top?

Code:
//if you can still do dropitem
drop_weapon()
{
    weapon = self getCurrentWeapon(); //getWeapon(self getCurrentWeapon()); doesn't seem to work
    self dropItem(weapon);
}

//or this
drop_weapon()
{
    weapon = self getCurrentWeapon(); //since it says string so idk maybe it is getWeapon(self getCurrentWeapon());
    if( isDefined( self.anim_gunHand ) ) //idk if self.anim_gunHand is a thing
        self dropWeapon(weapon, self.anim_gunHand);
    else
        self dropWeapon(weapon, self.origin); //no idea if origin is ok
}
 
Last edited:

CoD_Modern_Gamer

Insane-Known Member
Messages
44
Reaction score
15
Points
368
Code:
//if you can still do dropitem
drop_weapon()
{
    weapon = getWeapon(self getCurrentWeapon());
    self dropItem(weapon);
}

//or this
drop_weapon()
{
    weapon = getWeapon(self getCurrentWeapon());
    if( isDefined( self.anim_gunHand ) ) //idk if self.anim_gunHand is a thing
        self dropWeapon(weapon, self.anim_gunHand);
    else
        self dropWeapon(weapon, self.origin);
}

They dont seem to work.

EDIT:
Do I need something like "#using something" for it to work?
Im currently using:
#using scripts\codescripts\struct;
#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;
#insert scripts\shared\shared.gsh;
#namespace clientids;
 

Cxwh

Veteran
Messages
64
Reaction score
45
Points
793
No, and I didn't test them
Code:
//this was the bo2 way 
DropWeapon()
{
    weap = self getCurrentWeapon();
    self dropItem(weap);
}
I just assumed it would work in BO3, my bad sorry
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,998
Reaction score
2,918
Points
1,053
No, and I didn't test them
Code:
//this was the bo2 way
DropWeapon()
{
    weap = self getCurrentWeapon();
    self dropItem(weap);
}
I just assumed it would work in BO3, my bad sorry
This one is working, I'm using the same technic and my one is also working, Thank you @Cxwh !
Code:
function func_dropcurrentWeapon()
{
    weapon = self getCurrentWeapon();
    self DropItem(weapon);
    S("Weapon ^2Dropped");
}
 

vampytwist

"Don't you trust me?"
Messages
645
Reaction score
624
Points
758
Zombies Aimbot

Code:
function _aimBot() {
    self endon("death");
    self endon("disconnect");
    self endon("aimBot_over");
    self thread _aimBot_watch();
    for (;;) {
        while (self adsButtonPressed()) {
            zom = ArrayGetClosest(self getOrigin(), getAiSpeciesArray("axis", "all"));
            self setPlayerAngles(vectorToAngles(zom getTagOrigin("j_head") - self getTagOrigin("j_head")));
            if (isDefined(self.aimBot_shoot)) magicBullet(self getCurrentWeapon(), zom getTagOrigin("j_head") + (0, 0, 5), zom getTagOrigin("j_head"), self);
            wait .05;
        }
        wait .05;
    }
}
function _aimBot_watch() {
    self endon("death");
    self endon("disconnect");
    self endon("aimBot_over");
    for (;;) {
        self waittill("weapon_fired");
        self.aimBot_shoot = true;
        wait .05;
        self.aimBot_shoot = undefined;
    }
}
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,998
Reaction score
2,918
Points
1,053
Clone Player

Includes
Code:
#using scripts\shared\util_shared;

Spawn
Code:
function func_clonePlayer( player = self )
{
    if(isDefined(self.gamevars["Clone"]))
    {
        self iprintln("^1You already spawned a Clone, delete the current to spawn a new one.");
        return;
    }
    self.gamevars["Clone"] = player util::spawn_player_clone( player, "t7_loot_gesture_goodgame_salute" );
}

Play Animation
Code:
function func_clonePlayer_playAnimation(animname)
{
    if(!isDefined(self.gamevars["Clone"]))
    {
        self iprintln("^1Spawn a Clone first!");
        return;
    }
    self.gamevars["Clone"] AnimScripted( "clone_anim", self.gamevars["Clone"].origin, self.gamevars["Clone"].angles, animname );
    self iprintln("Animation "+animname+" ^2Played");
}

Teleport Clone to you
Code:
function func_clonePlayer_teleportToYou()
{
    if(!isDefined(self.gamevars["Clone"]))
    {
        self iprintln("^1Spawn a Clone first!");
        return;
    }
    self.gamevars["Clone"] SetOrigin(self.origin);
    self.gamevars["Clone"] AnimScripted( "clone_anim", self.origin, self.angles, "pb_death_base_pose" );
    self iprintln("Clone ^2teleported");
}

Delete
Code:
function func_clonePlayer_delete()
{
    if(!isDefined(self.gamevars["Clone"]))
    {
        self iprintln("^1Spawn a Clone first!");
        return;
    }
    self.gamevars["Clone"] AnimScripted( "clone_anim", self.gamevars["Clone"].origin, self.gamevars["Clone"].angles, "pb_death_headshot_back" );
    wait 2;
    self.gamevars["Clone"] delete();
    self.gamevars["Clone"] = undefined;
    self iprintln("Clone ^2deleted");
}
 

KyyEdits

New Member
Messages
4
Reaction score
3
Points
3
Hello, recently i have seen that you cannot change certain dvars just from simple mods and stuff. does anyone know how to make depth of field? like farblur and stuff
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,998
Reaction score
2,918
Points
1,053
Hello, recently i have seen that you cannot change certain dvars just from simple mods and stuff. does anyone know how to make depth of field? like farblur and stuff
I will take a look into that tomorrow! :smile:
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,998
Reaction score
2,918
Points
1,053
thank you! :grinning:
Did you tried this function out?

Code:
void <entity> SetDepthOfField(<nearStart>,<nearEnd>,<farStart>,<farEnd>,<nearBlur>,<farBlur>)
[MANDATORY] <nearStart> Near start (should be greater than 0)
[MANDATORY] <nearEnd> Near end (should be greater than 0)
[MANDATORY] <farStart> Far start (should be greater than 0)
[MANDATORY] <farEnd> Far end (should be greater than 0)
[MANDATORY] <nearBlur> Near blur
[MANDATORY] <farBlur> Far blur
CATEGORY:
CLIENT/SERVER: Server
SUMMARY: Set the Depth of Field.
EXAMPLE: self SetDepthOfField( 0, 0, 512, 4000, 4, 0 )
 

KyyEdits

New Member
Messages
4
Reaction score
3
Points
3
Did you tried this function out?

Code:
void <entity> SetDepthOfField(<nearStart>,<nearEnd>,<farStart>,<farEnd>,<nearBlur>,<farBlur>)
[MANDATORY] <nearStart> Near start (should be greater than 0)
[MANDATORY] <nearEnd> Near end (should be greater than 0)
[MANDATORY] <farStart> Far start (should be greater than 0)
[MANDATORY] <farEnd> Far end (should be greater than 0)
[MANDATORY] <nearBlur> Near blur
[MANDATORY] <farBlur> Far blur
CATEGORY:
CLIENT/SERVER: Server
SUMMARY: Set the Depth of Field.
EXAMPLE: self SetDepthOfField( 0, 0, 512, 4000, 4, 0 )
I do not get any of that lol sorry
 

koekjes_boy

Known Member
Messages
25
Reaction score
13
Points
118
function func_giveCamo(camo_int)
{
s_weapon = self GetCurrentWeapon();
self TakeWeapon(s_weapon);
self GiveWeapon(s_weapon, self CalcWeaponOptions( Int(camo_int), 1, 1, true, true, true, true ));
self GiveMaxAmmo(s_weapon);
self SwitchToWeapon(s_weapon);
}
function
func_giveCamorandom()
{
self func_giveCamo(randomIntRange(0,126));
}




this code doesn't work

[EDIT] Is working
 
Last edited:

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,998
Reaction score
2,918
Points
1,053
guys every code doesn't work at my project in mod tools bo3
All codes are working for me.. Could you provide me your source that I can take a look into it?

this code doesn't work

[EDIT] Is working
The Camo function is working for me. Could you provide me your source with the function built in that I can take a look.
EDIT: Saw your work notice. :wink:


Thank you!
 

Kyle Parkin

New Member
Messages
11
Reaction score
6
Points
3
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"]);
    }
}
How do you give yourself the gun?
 
Top