On-Screen Killstreak Counter

Topic created · 3 Posts · 132 Views
  • Hello, I'm new to the Pluto plugin/script development but I have some previous experience in Java (OOP alike).
    I friend of mine gave the script in c# for Tekno which displays the killstreak counter on screen. I wish to port this to Pluto MW3
    First of all, it would be great if some could clarify the pro and cons of using chaiscript rather than c++ plugins. What is the main difference (plugins more capable than scripts?).
    Which of those has the capability of doing some like this? Keep in mind that the counter should remain at a fixed position (let's say top screen).
    Has someone already made a similar thing?
    I really need someone to point me in the right direction before I start coding.
    Thanks

    Edit 1:
    Okay, I've read carefully other posts on this forum and this is where I am right now:
    1.PNG

    This is supposed to be the project setup.
    Now let's say I want to do the hello world message like in the tutorial.

    level.onNotify("connected", fun(arguments) {
    	var player = arguments[0];
    	
    	player.onNotify("spawned_player", fun[player](arguments) {
    		helloWorld(player);
    	});
    });
    
    def helloWorld(player)
    {
    	player.iPrintlnBold("^1Hello, world!");
    }
    

    where do I chuck this code? Do I need extra headers to code for Pluto?
    Thanks

  • There are currently two ways of modding Pluto. One is using unmanaged C++ code - that's what you have in Visual Studio. The other, and more limited, is using managed ChaiScript code - that's the one you have in the tutorial post.

    To load the code from the tutorial, simply save it as a .chai file in %localappdata%\Plutonium\storage\iw5\scripts folder.

  • I think this is enough to start
    In C ++, it will be very difficult to create such without knowledge

    // This is ChaiScript
    level.onNotify("connected", fun(arguments) {
            // you can make new var
            // var player = arguments[0];
    	var hud_text = gsc.newClientHudElem(arguments[0]);
    	hud_text.set("x", 0);
    	hud_text.set("y", 0);
    	hud_text.set("font", "hudbig");
    	hud_text.set("fontscale", 0.65);
    	hud_text.setText("^2HELLO WORLD, THIS IS HUD!");
    });
    

    There are a few problems:

    1. Do not spam SET/GET
    2. To update the numbers, it is better to use SetValue, not SetText (yes you have to tinker with the position, but otherwise your server may crash)
    3. Better to use Plutoscript Framework to handle event kill player
      alt text
Log in to reply