• 9 Vote(s) - 4.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Release] MW3 Server Addon Extensions
Would it be possible to add the KillPlayer() function to the extensions? I can't use it because I'm using addon version 1.413 and I don't think anyone will fix or update the addon anytime soon.
Thanks in advance!
  Reply
if the memory bug could be fixed that would be a start Wink
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

  Reply
Very good!
  Reply
Eh, got bored and thought I'd revive it. I've fixed Timing.cs, should no longer crash for people, thanks to @NTAuthority and *cough* Pigophone. Also, the .As<T> function can now take a bool. I've also added a Timing.Notify example that switches the player's team.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
  Reply
nice, just wondering is there a way to have anything other than care packages solid Smile
~FYANB~ Servers Website

Primary Account:
[Image: 76561198070236721.png]
Secondary Account:
[Image: 76561198096107676.png]
Third Account:
[Image: 76561198164751656.png]
  Reply
(01-02-2014, 06:25)Casper Wrote: nice, just wondering is there a way to have anything other than care packages solid Smile

That would be the SetContents function, I've played around with it in MW2 and it works miracles with map-specific xmodels (eg. playground slide or ice-cream sign from Favela). I'd have to port that over, shouldn't be too hard.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
  Reply
(01-02-2014, 06:48)master131 Wrote:
(01-02-2014, 06:25)Casper Wrote: nice, just wondering is there a way to have anything other than care packages solid Smile

That would be the SetContents function, I've played around with it in MW2 and it works miracles with map-specific xmodels (eg. playground slide or ice-cream sign from Favela). I'd have to port that over, shouldn't be too hard.
Thanks.
  Reply
Done, check the main post for updated code. To make a model solid (other than a carepackage), use:
Code:
Extensions.SetContents(entity, 1);

To make it non-solid again, use:
Code:
Extensions.SetContents(entity, 0);

Note: It's buggy on some models, because it literally makes a hidden box in the middle of the model to make it "solid". If you try it on the "vehicle_hummer_destructible" model in Dome, you'll notice you can still walk through the edges of the car but the middle is "solid". It works best with non-destructible stuff I believe.

Edit: Looks like the game is still crashing, might be Timing.cs again, I'm going to use a debugger and find out what's going on.

Edit #2: Yup, it's from the hook again, and I'm pretty sure I found the problem. The GC (garbage collector) is probably deleting/freeing the stub from Marshal.GetFunctionPointerFromDelegate because it assumes that I don't need it anymore (I only stored it in a local variable and used it once). Storing the variable as a global variable should solve the problem. After doing a search to prove my theory, I found this:

Quote:.NET disposes the function pointer when the delegate goes out of scope. Be really careful that your delegate remains in scope for the duration of time that the unmanaged code can call back - otherwise you'll potentially end up with a call to invalid memory triggering a process crash.

I've edited the main post again, should be stable now.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
  Reply
(01-02-2014, 07:34)master131 Wrote: Done, check the main post for updated code. To make a model solid (other than a carepackage), use:
Code:
Extensions.SetContents(entity, 1);

To make it non-solid again, use:
Code:
Extensions.SetContents(entity, 0);

Note: It's buggy on some models, because it literally makes a hidden box in the middle of the model to make it "solid". If you try it on the "vehicle_hummer_destructible" model in Dome, you'll notice you can still walk through the edges of the car but the middle is "solid". It works best with non-destructible stuff I believe.

Edit: Looks like the game is still crashing, might be Timing.cs again, I'm going to use a debugger and find out what's going on.

Edit #2: Yup, it's from the hook again, and I'm pretty sure I found the problem. The GC (garbage collector) is probably deleting/freeing the stub from Marshal.GetFunctionPointerFromDelegate because it assumes that I don't need it anymore (I only stored it in a local variable and used it once). Storing the variable as a global variable should solve the problem. After doing a search to prove my theory, I found this:
Quote:.NET disposes the function pointer when the delegate goes out of scope. Be really careful that your delegate remains in scope for the duration of time that the unmanaged code can call back - otherwise you'll potentially end up with a call to invalid memory triggering a process crash.

I think would be cheerful if to add bots. they are OnNotify(joined_spectators). it would be cheerful, better than to play with people here an example.


http://youtu.be/UqPO8Rofb0g
  Reply
(01-02-2014, 08:38)[HARD] Tony. Wrote: I think would be cheerful if to add bots. they are OnNotify(joined_spectators). it would be cheerful, better than to play with people here an example.


http://youtu.be/UqPO8Rofb0g

Will do. Also, I edited Timing.cs again because the correct way to solve the issue is mentioned here on MSDN using a GCHandle:
http://msdn.microsoft.com/en-us/library/367eeye0.aspx

EDIT - The GSC function AddTestClient is null-sub'ed, aka, it's been emptied out so it does absolutely nothing. I remember @NTAuthority made an modification which allowed it, will dig in and figure it out.

EDIT #2 - This looks like quite a bit of work to do, there's alot for me to patch and port to C#, I'll do it when I have time, I'm currently working on something else right now that's not MW3 related.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help, server Admin largosik 0 2,065 02-02-2019, 18:09
Last Post: largosik
  Add a point shop to my server h1dexyz 1 2,824 03-04-2018, 22:36
Last Post: h1dexyz
Lightbulb Preview Weapon Classe For Infected Clasic Server groochu1982 0 2,210 02-19-2017, 08:35
Last Post: groochu1982
Exclamation Help HOW CAN I TURN OFF THE "CROSSHAIR" IN MY SERVER? Eliichong0 0 2,502 06-16-2016, 16:01
Last Post: Eliichong0
Bug Upload files to FTP server S3VDIT0 4 4,173 01-28-2016, 17:17
Last Post: S3VDIT0

Forum Jump:


Users browsing this thread: 2 Guest(s)