Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

fedundefined

fed

@fed
About
Posts
32
Topics
4
Shares
0
Groups
1
Followers
67
Following
7

Posts

Recent Best Controversial

  • [Release] Lua Scripting
    fedundefined fed

    As many of you probably know the current chaiscript scripting is pretty bad and has many limitations. This plugin implements lua scripting in IW5 and fixes all those problems.

    Everything is basically the same as in IW6x (documentation can be found here).

    How

    • Download the latest version from the Releases tab
    • Copy it to %localappdata%/Plutonium/storage/iw5/plugins/
    • Create a __init__.lua file in a folder with a name of your choice in %localappdata%/Plutonium/storage/iw5/scripts/
    • Example %localappdata%/Plutonium/storage/iw5/scripts/myscript/__init__.lua
    • Run the server (preferably with the -no-scripting flag to disable ChaiScript)

    Below are some features that are not available or documented in IW6x

    Chat notifies

    level:onnotify("say", function(player, message)
        print(player.name .. " said: " .. message)
    end)
    

    or

    level:onnotify("connected", function(player)
        player:onnotify("say", function(message)
            print(player.name .. " said: " .. message)
        end)
    end)
    

    Player damage/killed callbacks

    Callbacks can be added using the game:onplayerkilled or game:onplayerdamage functions:

    Damage can be changed by returning it

    Returning anything other than a number will not do anything (must be an integer)

    game:onplayerdamage(function(_self, inflictor, attacker, damage, dflags, mod, weapon, point, dir, hitloc)
        damage = 0
    
        return damage
    end)
    
    game:onplayerkilled(function(_self, inflictor, attacker, damage, mod, weapon, dir, hitloc, timeoffset, deathanimduration)
        print(attacker.name .. " killed " .. _self.name)
    end)
    

    Arrays

    GSC arrays are supported and can be accessed similarly to gsc:

    local ents = game:getentarray()
    
    for i = 1, #ents do
        print(ents[i])
    end
    

    To get the array's keys use the getkeys method:

    local keys = player.pers.getkeys()
    
    for i = 1, #keys do
        print(keys[i])
    end
    

    Structs

    GSC structs are also supported similarly as the arrays.

    To get an entity's struct use the getstruct method:

    local levelstruct = level:getstruct()
    
    levelstruct.inGracePeriod = 10000
    

    Structs in other variables like arrays are automatically converted:

    level:onnotify("connected", function(player)
        player:onnotify("spawned_player", function()
            player.pers.killstreaks[1].streakName = "ac130"
            player.pers.killstreaks[1].available = 1
        end)
    end)
    

    Note: you cannot create new struct fields but only modify or read existing ones, same thing for arrays

    Functions

    You can call (will not work for every function) functions and methods within the game's gsc scripts using the

    scriptcall(filename, function, ...) method:

    level:onnotify("connected", function(player)
        player:onnotify("spawned_player", function()
            local hudelem = player:scriptcall("maps/mp/gametypes/_hud_utils", "createFontString", 1)
            
            hudelem:scriptcall("maps/mp/gametypes/_hud_util", "setPoint", "CENTER", nil, 100, 100)
            hudelem.label = "&Hello world"
        end)
    end)
    

    Functions in variables such as structs or arrays will be automatically converted to a lua function.

    The first argument must always be the entity to call the function on (level, player...)

    local levelstruct = level:getstruct()
    
    level:onnotify("connected", function(player)
        player:onnotify("spawned_player", function()
            levelstruct.killstreakFuncs["ac130"](player)
        end)
    end)
    
    MW3 Modding Releases & Resources

  • How sexy would this be? 👀
    fedundefined fed

    what would be sexy is your server not having cheats enabled

    General Discussion

  • Fed Servers
    fedundefined fed

    because youre banned idiot

    BO2 Client Support

  • did fed servers downed again?
    fedundefined fed

    suck my balls

    General Discussion

  • [For fun release] Guided AH-6
    fedundefined fed

    This solves the problem of settargetyaw missing

    if (heli_angles[1] > 360) { heli_angles[1] = 0; }
    if (heli_angles[1] < 0) { heli_angles[1] = 360; }
    var angle = heli_angles[1];
    var direction = [ heli.getOrigin()[0] + 100 * gsc.cos(angle), heli.getOrigin()[1] + 100 * gsc.sin(angle), heli.getOrigin()[2] ];
    var directionEnt = gsc.Spawn( "script_origin", direction);
    
    MW3 Modding Releases & Resources

  • Give killstreak
    fedundefined fed

    Alright so this is what I came up with, its not perfect but works.
    Only needs the aftermath effect or whatever its called

    // player is the player that got the nuke
    def nukePlayers(player) {
    	gsc.setDvar("ui_bomb_timer", 4);
    	gsc.setDvar("ui_nuke_end_milliseconds", gsc.gettime() + 10 * 1000);
    	gsc.iPrintlnBold("^1TACTICAL NUKE INCOMING");
    	var count = 0;
    	gsc.playsound("ui_mp_nukebomb_timer");
    	setInterval(fun[count]() {
    		if (count < 10) {
    			gsc.playsound("ui_mp_nukebomb_timer");
    			++count;
    		}
    	}, 1000);
    	setTimeout(fun[player]() {
    		gsc.playsound("nuke_explosion");
    		gsc.playsound("nuke_wave");
    		gsc.SetSlowMotion( 1.0, 0.25, 0.5 );
    		gsc.setDvar("ui_bomb_timer", 0);
    		setTimeout(fun[player]() {
    			// kills all players except the one that got the nuke
    			for (var i = 0; i < players.size; ++i) {
    				if (players[i].getGuid() == player.getGuid()) {
    					continue;
    				}
    				explodePlayer(players[i], player);
    				var playerN = players[i];
    				playerN.onNotify("death", fun[playerN](arguments) {
    					playerN.setempjammed(true);
    					gsc.SetSlowMotion( 0.25, 1, 2.0 );
    				});
    			}
    		        endMatch();
    		}, 2000);
    	}, 10000);
    }
    
    // shoots an ac130 round at the player
    def explodePlayer(player, attacker) {
    	var eye = player.getEye();
    	var end = player.getOrigin();
    	gsc.MagicBullet("ac130_105mm_mp", [eye[0], eye[1], eye[2] + 70 ], eye, attacker);
    }
    
    def endMatch() {
    	gsc.setDvar("scr_dm_timelimit", 0.001);
    }
    
    MW3 Modding Support & Discussion

  • [For fun release] Guided AH-6
    fedundefined fed

    I did try setOrigin but the server crashed, and you're right, I played for about 2 mins and it also crashed, would deleting directionEnt fix this?

    MW3 Modding Releases & Resources

  • [For fun release] Guided AH-6
    fedundefined fed

    Changed it to this and it works fine

    def TurretLinkerToHelicopter(heli, player)
    {
        var tagOrigin = heli.gettagorigin("tag_player_attach_left");
        var turret = gsc.spawnTurret( "misc_turret", [ tagOrigin[0], tagOrigin[1], tagOrigin[2] + 30] , "sentry_minigun_mp" );
        turret.setModel("weapon_minigun");
        turret.maketurretoperable();
        turret.makeUsable();
        turret.linkto(heli, "tag_player_attach_left");
        player.remotecontrolturret(turret);
    }
    

    And this otherwise player is in the way

    player.PlayerLinkTo(heli, "tag_player_attach_right", .5f, 10, 170, 30, 150, false);
    
    MW3 Modding Releases & Resources

  • [Release] Lua Scripting
    fedundefined fed

    @ScottieC111
    1 - Copy the plugin to Plutonium/storage/iw5/plugins/
    2 - Create a file in Plutonium/storage/iw5/scripts/yourscript/__init__.lua and copy the code into it
    3 - Run the server

    MW3 Modding Releases & Resources
  • 1 / 1
  • Login

  • Don't have an account? Register

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