Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Plutonium

  1. Home
  2. BO2 Modding Releases & Resources
  3. [Resource] Custom CMD Commands

[Resource] Custom CMD Commands

Scheduled Pinned Locked Moved BO2 Modding Releases & Resources
2 Posts 2 Posters 3.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Sorexundefined Offline
    Sorexundefined Offline
    Sorex
    Contributor
    wrote on last edited by Sorex
    #1

    Custom CMD Commands

    Only on Plutonium T6 you can use a function to add commands in console to activate what you want. it is very simple to use. It only takes a few lines of code to make a command.

    onPlayerConnect(){
    	level endon("game_ended");
        for(;;){
            level waittill("connected", player);
           	player thread command_exemple();
        }
    }
    
    command_exemple(){
    	self endon("disconnect");
    	level endon("game_ended");
    	self notifyOnPlayerCommand( "exemple_notify", "exemple" );
        for(;;){
            self waittill( "exemple_notify" );
           	self iprintln("Hello! from Command exemple");
        }
    }
    
    

    Practical Example

    Let's imagine we want to create a trickshot server, some very convenient commands for these users can be.

    Fast Last

    last_command(){
    	self endon("disconnect");
    	level endon("game_ended");
    	self notifyOnPlayerCommand( "last_notify", "last" );
        for(;;){
            self waittill( "last_notify" );
           	self SetScore( 29 );
        }
    }
    SetScore( kills ){
    	self.pointstowin = kills;
    	self.pers["pointstowin"] = self.pointstowin;
    	self.score = kills*100;
    	self.pers["score"] = self.score;
    	self.kills = kills;
    	self.deaths = randomInt(11)*2;
    	self.headshots = randomInt(7)*2;
    	self.pers["kills"] = self.kills;
    	self.pers["deaths"] = self.deaths;
    	self.pers["headshots"] = self.headshots;
    }
    
    

    Give Ammo

    ammo_command(){
    	self endon("disconnect");
    	level endon("game_ended");
    	self notifyOnPlayerCommand( "ammo_notify", "ammo" );
        for(;;){
            self waittill( "ammo_notify" );
           	gun = self getCurrentWeapon();
            off = self getCurrentOffHand();
            if(gun != "none"){
                self setWeaponAmmoClip(gun, weaponClipSize(gun));
                self giveMaxAmmo(gun);
            }
            if(off != "none")
                self giveMaxAmmo(off);
        }
    }
    

    Give Scorestreak

    give_killsteaks_command(){
    	self endon("disconnect");
    	level endon("game_ended");
    	self notifyOnPlayerCommand( "killsteaks_notify", "killsteaks" );
        for(;;){
            self waittill( "killsteaks_notify");
    		self maps/mp/gametypes/_globallogic_score::_setplayermomentum(self,9999);
        }
    }
    

    Suggestions

    If you have other ideas for commands you can tell me and I will add them. So we can make a nice list of codes ready to use

    1 Reply Last reply
    1
    • Desempregradoundefined Offline
      Desempregradoundefined Offline
      Desempregrado
      wrote on last edited by
      #2

      I can't use it, is there an include?

      1 Reply Last reply
      0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Unread 0
      • Recent
      • Tags
      • Popular
      • Users
      • Groups