Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
question
#21
(02-18-2012, 13:14)zxz0O0 Wrote:
(02-18-2012, 13:04)blueberry9 Wrote: now i need to test it, right?
Yeah, now put it on dedicated server.

i did.

got nothing.
no unlimited sprint.
tried enabling the dvar and that didn't work.

i wanted the dll to produce a config section in the sv_config.cfg.

i'm assuming i need some code like this which is from Pozzuhs Speed Plugin:

Code:
ServerPrint("Speed plugin loaded. Author: Pozzuh. Version 1.3");

if (GetServerCFG("SPEEDPLUGIN", "Speed", "-1") == "-1")
SetServerCFG("SPEEDPLUGIN", "Speed", "190");
if (GetServerCFG("SPEEDPLUGIN", "JumpHeight", "-1") == "-1")
SetServerCFG("SPEEDPLUGIN", "JumpHeight", "39");
if (GetServerCFG("SPEEDPLUGIN", "FallDamage", "-1") == "-1")
SetServerCFG("SPEEDPLUGIN", "FallDamage", "1");

try
{
g_speed_var = Convert.ToInt32(GetServerCFG("SPEEDPLUGIN", "Speed", "190"));
jump_height_var = Convert.ToInt32(GetServerCFG("SPEEDPLUGIN", "JumpHeight", "39"));
fall_damage_var = Convert.ToInt32(GetServerCFG("SPEEDPLUGIN", "FallDamage", "1"));
}

maybe something like this??

Code:
ServerPrint("sprintUnlimited plugin loaded.");

if (GetServerCFG("SPRINTPLUGIN", "Sprint", "-1") == "-1")
SetServerCFG("SPRINTPLUGIN", "Sprint", "Enabled");


try
{
player_sprintUnlimited_var = Convert.ToInt32(GetServerCFG("SPRINTPLUGIN", "Sprint", "1"));
}
[Image: c2ship5_sig.png]
Reply

#22
Just try now without sv_config.ini. We don't know if the adresses work.

Do you have set the project to .NET Framework 3.0 in properties?
[Image: azuw.jpg]
Reply

#23
(02-18-2012, 13:37)zxz0O0 Wrote: Just try now without sv_config.ini. We don't know if the adresses work.

Do you have set the project to .NET Framework 3.0 in properties?
not yet.
doing now

saved as 3.0
(02-18-2012, 13:41)blueberry9 Wrote:
(02-18-2012, 13:37)zxz0O0 Wrote: Just try now without sv_config.ini. We don't know if the adresses work.

Do you have set the project to .NET Framework 3.0 in properties?
not yet.
doing now

changed the target framework to 3.0


i tested the dll.
it didn't work
[Image: c2ship5_sig.png]
Reply

#24
i'm using VCE now instead of VS.
it's easier for a n00b like me.

as was mentioned earlier, the offsets may be incorrect.
but my code builds fine in VCE (Framework 4.0) until i set the .NET Framework to 3.0.
then all the errors and warnings pop up.

here's the code:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using Addon;

namespace plugin_test
{
    //"<class name> : CPlugin" is needed to inherit the functions
    public class plugin_test : CPlugin
    {
        //Example overrides for functions
        public override void OnServerFrame()
        {
        }

        [DllImport("kernel32.dll")]
        static extern bool VirtualProtect(IntPtr lpAddress, uint dwSize,
        uint flNewProtect, out uint lpflOldProtect);

        unsafe public override void OnServerLoad()
        {
            ServerPrint("Plugin: sprintUnlimited loaded");

            uint lol = 0;
            uint size = 0x4;
            uint pro = 0x40;

            IntPtr addr = (IntPtr)0x587CD34;
            IntPtr addr2 = (IntPtr)0x587CD50;
            IntPtr addr3 = (IntPtr)0x587CD60;

            VirtualProtect(addr, size, pro, out lol);
            VirtualProtect(addr2, size, pro, out lol);
            VirtualProtect(addr3, size, pro, out lol);
            *(int*)0x587CD34 = 1;
            *(int*)0x587CD50 = 1;
            *(int*)0x587CD60 = 1;
        }

        public override ChatType OnSay(string Message, ServerClient Client)
        {
            return Addon.ChatType.ChatContinue;
        }

        public override string OnCheckBan(string xuid)
        {
            //Return a string if the player is banned
            //otherwise return null
            //xuid = xuid in the "status" command
            return null;
        }
    }
}
[Image: c2ship5_sig.png]
Reply

#25
Plugins only work if they are compiled with .NET Framework 3.0.

Linq is a new feature in .NET Framework 3.5 (see http://msdn.microsoft.com/en-us/library/....linq.aspx ) and does not exist in 3.0.

Remove this line from your code
Code:
using System.Linq;
and also remove it from References
[Image: azuw.jpg]
Reply

#26
(02-20-2012, 16:06)zxz0O0 Wrote: Plugins only work if they are compiled with .NET Framework 3.0.

Linq is a new feature in .NET Framework 3.5 (see http://msdn.microsoft.com/en-us/library/....linq.aspx ) and does not exist in 3.0.

Remove this line from your code
Code:
using System.Linq;
and also remove it from References

thanks.
addon.dll is also a problem with 3.0
what to do about that?
[Image: c2ship5_sig.png]
Reply

#27
(02-20-2012, 16:23)blueberry9 Wrote:
(02-20-2012, 16:06)zxz0O0 Wrote: Plugins only work if they are compiled with .NET Framework 3.0.

Linq is a new feature in .NET Framework 3.5 (see http://msdn.microsoft.com/en-us/library/....linq.aspx ) and does not exist in 3.0.

Remove this line from your code
Code:
using System.Linq;
and also remove it from References

thanks.
addon.dll is also a problem with 3.0
what to do about that?
No it should not be a problem. Though maybe you use an old version. Remove addon.dll from References, download latest version from here: http://cod6hmod.itshax.com/mw3_addon/ and add latest addon.dll again to References.
[Image: azuw.jpg]
Reply

#28
(02-20-2012, 16:31)zxz0O0 Wrote:
(02-20-2012, 16:23)blueberry9 Wrote:
(02-20-2012, 16:06)zxz0O0 Wrote: Plugins only work if they are compiled with .NET Framework 3.0.

Linq is a new feature in .NET Framework 3.5 (see http://msdn.microsoft.com/en-us/library/....linq.aspx ) and does not exist in 3.0.

Remove this line from your code
Code:
using System.Linq;
and also remove it from References

thanks.
addon.dll is also a problem with 3.0
what to do about that?
No it should not be a problem. Though maybe you use an old version. Remove addon.dll from References, download latest version from here: http://cod6hmod.itshax.com/mw3_addon/ and add latest addon.dll again to References.

ok.
thanks again.
i'll try that when i get home

[Image: c2ship5_sig.png]
Reply

#29
(02-20-2012, 17:19)blueberry9 Wrote:
(02-20-2012, 16:31)zxz0O0 Wrote:
(02-20-2012, 16:23)blueberry9 Wrote:
(02-20-2012, 16:06)zxz0O0 Wrote: Plugins only work if they are compiled with .NET Framework 3.0.

Linq is a new feature in .NET Framework 3.5 (see http://msdn.microsoft.com/en-us/library/....linq.aspx ) and does not exist in 3.0.

Remove this line from your code
Code:
using System.Linq;
and also remove it from References

thanks.
addon.dll is also a problem with 3.0
what to do about that?
No it should not be a problem. Though maybe you use an old version. Remove addon.dll from References, download latest version from here: http://cod6hmod.itshax.com/mw3_addon/ and add latest addon.dll again to References.

ok.
thanks again.
i'll try that when i get home

that did the trick.
thanks!
i was able to build the dll.
but it caused the server not to run and i got a crash dump error relative to this address: "0x6DA709" which is not even in the code. but "0x6DA708" is.

so i removed "0x6DA708" and the server ran but no unlimited sprint.

here's the edit i made:

Code:
IntPtr addr = (IntPtr)0x6D9634;
            IntPtr addr2 = (IntPtr)0x6DE490;

            plugin_test.VirtualProtect(addr, size, pro, out lol);
            plugin_test.VirtualProtect(addr2, size, pro, out lol);      
            *(float*)0x6D9634 = 1.0f;
            *(float*)0x6DE490 = 1.0f;

i realize that by removing that address i could be disabling something i want to be in the plugin. just not sure what dvar that address represents
[Image: c2ship5_sig.png]
Reply

#30
Ok. Now either the addresses are wrong or it isn't loaded yet. You can try to move it to OnMapChange() if it doesn't work there then the addresses are wrong.
[Image: azuw.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help Mw2 weapon skin question FroxIVx4 1 2,950 10-13-2013, 16:54
Last Post: hmann
Rainbow please help me = question's clacki 1 2,374 09-24-2013, 15:22
Last Post: OzonE
  [Request] Might be a silly question... regarding SetPlayerData camxxcore 4 3,899 08-10-2013, 21:50
Last Post: camxxcore
  A question about the Call of Duty Black Ops king_dom 1 3,703 07-08-2013, 05:26
Last Post: DidUknowiPwn
  Help Mw2 weapon skin question FroxIVx4 1 2,920 07-06-2013, 19:22
Last Post: surtek
  Question on how to "Spawn" a flying rocket as a player? akillj 8 5,539 06-04-2013, 01:54
Last Post: rotceh_dnih
  bot question meisking 1 2,047 04-13-2013, 11:02
Last Post: SuperNovaAO
  Help [QUESTION][IDEA] Invisible Wall 99IRock 8 5,494 03-03-2013, 14:37
Last Post: Nekochan
Wink Help question [HARD] Tony. 12 7,974 03-02-2013, 22:54
Last Post: JariZ
  A Question supernuke 2 2,281 02-22-2013, 15:45
Last Post: supernuke

Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.