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

Plutonium

fedundefined

fed

@fed
About
Posts
32
Topics
4
Groups
1
Followers
66
Following
7

Posts

Recent Best Controversial

  • [Release] Lua Scripting
    fedundefined fed

    st0rm not sure why it crashes but doing this works fine:

    function onPlayerSpawned( player )
        game:ontimeout(function()
            if(player:hasperk("specialty_grenadepulldeath") == 1) then
                print(player.name .. " is using marty")
            end	
        end, 0)
    end
    
    function onPlayerConnected( player )
        local spawnListener = player:onnotify("spawned_player", function() onPlayerSpawned(player) end)
    end
    
    level:onnotify("connected", onPlayerConnected)
    

  • did fed servers downed again?
    fedundefined fed

    suck my balls


  • I get disconnected from your servers
    fedundefined fed

    I whitelisted you


  • [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


  • [Release] Lua Scripting
    fedundefined fed

    Put that in a file like Plutonium/storage/iw5/scripts/yourscript/__init__.lua


  • [Release] Lua Scripting
    fedundefined fed

    Xedi yes


  • [Release] Lua Scripting
    fedundefined fed

    Xx_Phoenix_xX i think this is what you mean

    game:onplayerdamage(function(_self, inflictor, attacker, damage, dflags, mod, weapon, point, dir, hitloc)
        if (game:isplayer(attacker) ~= 1 or _self.sessionteam == attacker.sessionteam or _self == attacker) then
            return
        end
    
        local huddamage = game:newclienthudelem(attacker)
        huddamage.alignx = "center"
        huddamage.horzalign = "center"
        huddamage.x = 10
        huddamage.y = 235
        huddamage.fontscale = 1.6
        huddamage.font = "objective"
        huddamage:setvalue(damage)
    
        if (hitloc == "head") then
            huddamage.color = vector:new(1, 1, 0.25)
        end
    
        huddamage:moveovertime(1)
        huddamage:fadeovertime(1)
        huddamage.alpha = 0
        huddamage.x = math.random(25, 70)
        huddamage.y = 235 + math.random(25, 70) * (math.random(0, 1) == 1 and -1 or 1)
    
        game:ontimeout(function()
            huddamage:destroy()
        end, 1000)
    end)
    

  • [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)
    

  • [Bug][IW5] ChaiScript Unable to unbox value of type 'unsigned int'
    fedundefined fed

    Use to_int()


  • i need your help
    fedundefined fed

    Akira5383 hopefully by next week


  • i need your help
    fedundefined fed

    Mr. Android vps panel doesn't work so i have no way to find out but i really hope not


  • How sexy would this be? ๐Ÿ‘€
    fedundefined fed

    what would be sexy is your server not having cheats enabled


  • Fed Servers
    fedundefined fed

    because youre banned idiot


  • Fed servers
    fedundefined fed

    you can get the link by just typing !discord ingame


  • [chaiscript] Need help to interact with chat_message
    fedundefined fed

    Doubt chat_message even exists and arguments usually has either the player or nothing at all so youโ€™re probably better off making a IW4M plugin


  • Question / Help (Scripts/Codes)
    fedundefined fed

    To update scripts you just have to restart the map, even a simple fast_restart will do.
    For keybinds:

    def playerConnected(arguments) {
    	var player = arguments[0]
            var thing = "thing"
            //  player.notifyOnPlayerCommand(name, keybind);
            player.notifyOnPlayerCommand("actionslot6", "+actionslot 6")
            // other notifies are for example "spawned_player", "weapon_fired", "death", "killed_enemy"
            player.onNotify("actionslot6", fun[thing/* pass variables here*/](arguments){
                 // do whatever...
                 player.iPrintLn(thing)
            });
    }
    level.onNotify("connected", playerConnected);
    

    To teleport players, for example to yourself (you cannot tp them to where youre aiming unfortunately because the bulletTrace function that should be used for it doesn't work)

    def playerConnected(arguments) {
    	var player = arguments[0]
            player.notifyOnPlayerCommand("actionslot6", "+actionslot 6")
            player.onNotify("actionslot6", fun(arguments){
                for (var i = 0; i < 18; ++i) {
                        // Players are the first 18 entities so you can just use gsc.getEntByNum() to get a player with a given clientslot
                    var playerEnt = gsc.getEntByNum(i);
                    if (playerEnt.getGuid() != player.getGuid()) {
                        playerEnt.setOrigin(player.getOrigin())
                    }
            }
        });
    }
    level.onNotify("connected", playerConnected)
    
    

    To set perks

    // player.setperk(perk, true, true)
    player.setperk("specialty_scavenger", true, true)
    player.setperk("specialty_bulletaccuracy", true, true)
    player.setperk("specialty_fastreload", true, true)
    player.setperk("specialty_quickdraw", true, true)
    // Not sure if they all work at the same time
    

    You can also find the list of functions and other stuff at
    https://github.com/momo5502/open-iw5/blob/master/src/game/scripting/functions.cpp


  • hi guys any help
    fedundefined fed

    there is actually, i made it but im not going to share it


  • Bans page
    fedundefined fed

    Why not make a page that shows a live ban count and maybe a chart too, I think it would be pretty cool


  • [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);
    
  • 1
  • 2
  • 1 / 2
  • Login

  • Don't have an account? Register

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