Results 1 to 2 of 2
  1. #1
    nagendhrabanoth's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    17
    Reputation
    10
    Thanks
    0
    My Mood
    Amazed

    fourdeltaone scripts or plugins help!

    what i have to change in itsmod scripts/plugins to make work for fourdeltaone ??can any give me any kind of suggestions for converting it????

  2. #2
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,473
    Reputation
    564
    Thanks
    5,885
    My Mood
    Psychedelic
    You can't simply "Change things" on it.

    You should look inside the IW5M/scripts/src/ folder. There's a few examples there on how you write scripts.
    I really hope you know some basic C# as you'll need it to convert it yourself.

    Eg. Here's an AntiCamp script:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    using InfinityScript;
    
    namespace InfinityScript.Examples
    {
        public class AntiCamp : BaseScript
        {
            private bool _donePrematch = false;
            private List<Entity> _safeTriggers = new List<Entity>();
    
            public AntiCamp()
            {
                var gameType = Call<string>("getDvar", "g_gametype").ToLower();
    
                for (int i = 0; i < 2048; i++)
                {
                    var entity = Call<Entity>("getEntByNum", i);
    
                    if (entity != null)
                    {
                        var targetname = entity.GetField<string>("targetname");
    
                        if (gameType == "dom")
                        {
                            if (targetname == "flag_primary" || targetname == "flag_secondary")
                            {
                                _safeTriggers.Add(entity);
                            }
                        }
                        else if (gameType == "koth")
                        {
                            if (targetname == "radiotrigger")
                            {
                                _safeTriggers.Add(entity);
                            }
                        }
                    }
                }
    
                // only trigger anticamp after the game started
                OnNotify("prematch_done", () =>
                {
                    _donePrematch = true;
                });
    
                // don't trigger anticamp after the game ended
                OnNotify("game_over", () =>
                {
                    _donePrematch = false;
                });
    
                PlayerConnecting += new Action<Entity>(entity =>
                {
                    // bombsite using
                    entity.SetField("ac_using", 0);
    
                    entity.OnNotify("use_hold", player =>
                    {
                        player.SetField("ac_using", 1);
                    });
    
                    entity.OnNotify("done_using", player =>
                    {
                        player.SetField("ac_using", 0);
                    });
    
                    entity.OnInterval(4000, player =>
                    {
                        if (!player.IsAlive)
                        {
                            return true;
                        }
    
                        if (!_donePrematch)
                        {
                            return true;
                        }
    
                        if (player.GetField<int>("ac_using") != 0)
                        {
                            return true;
                        }
    
                        foreach (var safeEntity in _safeTriggers)
                        {
                            if (player.Call<int>("istouching", safeEntity) != 0)
                            {
                                Log.Write(LogLevel.Trace, "touching safe entity");
                                return true;
                            }
                        }
    
                        if (player.Call<int>("istalking") != 0)
                        {
                            Log.Write(LogLevel.Trace, "talking");
                            return true;
                        }
    
                        if (player.HasField("ac_lastPos"))
                        {
                            var lastPos = player.GetField<Vector3>("ac_lastPos");
    
                            if (lastPos.DistanceTo2D(player.Origin) < 50)
                            {
                                player.Call("iprintlnbold", "You will be killed if you do not move.");
    
                                var oldHealth = player.Health;
                                player.Health /= 3;
                                player.Notify("damage", (oldHealth - player.Health), player, new Vector3(0, 0, 0), new Vector3(0, 0, 0), "MOD_EXPLOSIVE", "", "", "", 0, "frag_grenade_mp");
    
                                if (player.Health < 5)
                                {
                                    player.Call("suicide");
                                }
                            }
                        }
    
                        player.SetField("ac_lastPos", player.Origin);
    
                        return true;
                    });
                });
            }
        }
    }
    You can see how it differs from a normal ServerAddon script.

Similar Threads

  1. [Help Request] "Script requires Player" Help!
    By Penaloza1337 in forum DayZ Help & Requests
    Replies: 6
    Last Post: 05-23-2013, 11:56 PM
  2. Plugin help for server admin
    By Evan007 in forum Minecraft Discussions
    Replies: 2
    Last Post: 12-23-2011, 08:05 PM
  3. DTX plugin help
    By kg36 in forum Combat Arms Mod Discussion
    Replies: 3
    Last Post: 08-19-2010, 09:45 AM
  4. NEXON PLUGIN HELP!!
    By sevon89 in forum WarRock Korea Hacks
    Replies: 0
    Last Post: 07-05-2008, 02:14 AM
  5. Replies: 1
    Last Post: 07-05-2006, 07:20 AM