WARNING: The forum is now in read-only mode as we will soon be transitioning to different forum software. Feel free to join our Discord server in the meantime.
fiki574
Posts:16
Joined:Mon Dec 17, 2012 6:07 pm
iSnipe v1.0

Tue Dec 25, 2012 3:39 pm

Hello!

So, today I saw that NoFaTe released pre-release of new client and that he made an extension system! I decided to mess around with it a bit, and created this "iSnipe" mod (which isn't nowhere near same like CoD's one, but still it's nice)! And as NoFaTe stated, there are just few functions that we can use at this point, but I hope there will be more in future!

[syntax lang="csharp" lines=""]using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;
using Nexus;

namespace iSnipe
{
public class iSnipe : RomeExt
{
public static DamageInfo info; //damage information class
public static RomeSoldier soldier; //player-soldier information class
public static Timer timer = new Timer(100); //initialising our timer which will be called 10 times a second
public override void OnLevelLoading(string name, bool is_singleplayer) //our callback that gets called by server when loading a level
{
if (!is_singleplayer) //check if there's more than 1 player
{
SetInstantSpawnEnabled(true); //allow instant spawn after death
SetUnlimitedMagsEnabled(false); //disallow unlimited bullet magazines
SetUnlimitedAmmoEnabled(false); //disallow unlimited ammo storage
SetVehiclesEnabled(false); //disallow all vehicles in server
SetWeaponsEnabled(false, new List<string> { "M24" }); //disallow all weapons except M24 sniper rifle
SetAllowedKits(new List<string>() { "KIT_RECON" }); //disallow all kits except Recon kit
info.ExplosionDamage = false; //explosions will now do 0 damage
info.DemolitionDamage = false; //destroyed building which will collapse won't do any damage to players beneath them
info.Stamina = 0x7F800000; //set stamina to infinity a.k.a never stop sprinting
}
}

public override void OnLevelLoaded() //our callback that gets called by server when level has been loaded
{
TimerCheck(); //calling a timer check
}

public void TimerCheck() //our timer check
{
timer.Elapsed += new ElapsedEventHandler(OnTimedEvent); //call event when 0.1 second passed
timer.Interval = 100; //interval is set to 0.1 second
timer.Enabled = true; //enable elapsed event handler
}

public void OnTimedEvent(object source, ElapsedEventArgs e) //our timed event for each 0.1 second
{
OnPlayerUpdate(soldier, info); //call update function
}

public void OnPlayerUpdate(RomeSoldier r_sold, DamageInfo d_info) //our update callback thats called each 100 milliseconds
{
//do stuff here
}

public override void OnExtensionLoaded() //our callback that gets called when extension is loaded
{
//do stuff here
}
}
}
[/syntax]

There are quite of few stuff missing, like anti-camping and limiting the marksmanship mode with a timer, but I'll add that in later versions of this mod! Though anti-camping can already be made with provided vectors and other functions, I just "canceled" that part for future! You can also see that some functions are empty (like "OnPlayerUpdate") -> that's because of the previously named reasons and lack of flexibility, but I can guarantee you that they'll be used in future updates of this extension!

And as a note, I haven't yet tested this mod, so if anyone wanna host it we can try it out together (just find me on TS)! ;)

Also, I was not sure for meanings of some functions, but I tried to guess what they are doing and I've commented them nicely!


Have fun and merry christmas!
Regards,
Fiki! :)
Last edited by fiki574 on Wed Dec 26, 2012 7:58 pm, edited 1 time in total.

User avatar
Avail
Posts:6
Joined:Tue Dec 25, 2012 9:56 pm

Re: iSnipe v1.0

Tue Dec 25, 2012 11:38 pm

That's amazing !
When I finally can be arsed, I will get a server with your mod on it. :P
"No matter how far we are, we're always looking at the same sky"
[img]robbinghood.me/rome/banner.php?p=RobbingHood&c=000000[/img]

User avatar
rohunter
Posts:181
Joined:Tue Dec 18, 2012 10:35 pm

Re: iSnipe v1.0

Wed Dec 26, 2012 5:46 am

nice .. maybe well host it for a test ... just wait a few days ;) ok so my server its up ... if u need to test it just pm me .. and help me put it:))

fiki574
Posts:16
Joined:Mon Dec 17, 2012 6:07 pm

Re: iSnipe v1.0

Wed Dec 26, 2012 6:34 pm

Avail wrote:That's amazing !
When I finally can be arsed, I will get a server with your mod on it. :P


rohunter wrote:nice .. maybe well host it for a test ... just wait a few days ;) ok so my server its up ... if u need to test it just pm me .. and help me put it:))


OK, thanks both! :)

User avatar
rohunter
Posts:181
Joined:Tue Dec 18, 2012 10:35 pm

Re: iSnipe v1.0

Thu Dec 27, 2012 4:07 am

fiki574 wrote:
Avail wrote:That's amazing !
When I finally can be arsed, I will get a server with your mod on it. :P


rohunter wrote:nice .. maybe well host it for a test ... just wait a few days ;) ok so my server its up ... if u need to test it just pm me .. and help me put it:))


OK, thanks both! :)

as i see u know coding .. can u help me with a mod ? i need 1 in the chamber mod ... one in pistol and one in riffle thx and waiting ur answere

fiki574
Posts:16
Joined:Mon Dec 17, 2012 6:07 pm

Re: iSnipe v1.0

Thu Dec 27, 2012 8:29 am

rohunter wrote:as i see u know coding .. can u help me with a mod ? i need 1 in the chamber mod ... one in pistol and one in riffle thx and waiting ur answere


Well I could, but unfortunately there's no function(s) for bullet ammount manipulating (except for unlimited mag/ammo stored), so you'll have to wait until NoFaTe (and IF he) implements it into extension thingy! ;)

User avatar
RobbingHood
Posts:3305
Joined:Mon Dec 17, 2012 8:50 pm

Re: iSnipe v1.0

Thu Dec 27, 2012 12:39 pm

Yeah, fiki is right. The extension system as it is now only offers very limited functions.

But NoFaTe is working on it, so maybe we can do something like a One-In-The-Chamber Mod soon.

NoFaTe wrote:Yes, as previously stated this is just a pre-release with a limited set of features.
More modding features will come in the near future.

fiki574
Posts:16
Joined:Mon Dec 17, 2012 6:07 pm

Re: iSnipe v1.0

Thu Dec 27, 2012 7:06 pm

RobbingHood wrote:But NoFaTe is working on it, so maybe we can do something like a One-In-The-Chamber Mod soon.


Indeed! :)

User avatar
rohunter
Posts:181
Joined:Tue Dec 18, 2012 10:35 pm

Re: iSnipe v1.0

Thu Dec 27, 2012 10:35 pm

RobbingHood wrote:Yeah, fiki is right. The extension system as it is now only offers very limited functions.

But NoFaTe is working on it, so maybe we can do something like a One-In-The-Chamber Mod soon.

NoFaTe wrote:Yes, as previously stated this is just a pre-release with a limited set of features.
More modding features will come in the near future.

i have a wery good ideea for that mod ,,,, hope it can be done soune

User avatar
yolarrydabomb
Posts:23
Joined:Sat Dec 22, 2012 2:47 am

Re: iSnipe v1.0

Tue Feb 19, 2013 4:31 am

inb4 this becomes a popular mod. :)

Return to “Modifications”

Who is online

Users browsing this forum: No registered users and 33 guests