Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need a little help /w plugin
#1
ive been trying to make a god mode plugin..
when i try to compile it, i get an error saying: unsafe code may only appear when compiling/ with unsafe..
i dont really know what to do to fix that error.. im guessing that i have to add an exception to the addon.dll in the addon folder so that it will allow me to compile it even though it says its not safe....
im trying to make the plugin for 1.4.382 version....
i watched a vid from its mods on making plugins and they said to use 3.0 framework, but when i use that version, theres like 10 errrors, but on version 4.0 i dont get any...
sorry if im being a noob... this is my first time making a plugin

here is the soruce code:
using System;
using System.Runtime.InteropServices;
using System.Security;
using Addon;

namespace GODMODE_1_0
{
public class Program : CPlugin
{
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool WriteProcessMemory(IntPtr hProcess, int lpBaseAddress, byte[] lpBuffer, int nSize, out int lpNumberOfBytesWritten);

public override void OnMapChange()
{
SetDvar(" scr_player_maxhealth", "999");
}
unsafe public override void OnServerLoad()
{
ServerPrint("Plugin: GOD MODE made by th3oolbro has been loaded");

int oP;
byte[] bytes = { 0x90, 0x90 };
WriteProcessMemory(((IntPtr)(-1)), 0x40C8D7, bytes, bytes.Length, out oP);
}
}
}
Reply

#2
Go to your build settings and allow unsafe code.
[Image: MaEIQ.png]
Reply

#3
A much better alternative would be to set the health to -1. This way you can control who becomes god and who doesn't.A wild guess but if you are working in 64 bit environment check the target CPU it should be x86
Reply

#4
(09-01-2012, 09:58)Gravzy Wrote: Since thread has been answered, can i ask, why would you want everybody to have god mode?
well thats just the first part of the project,, and because its my first time i ever did something with programing... i wanted to make it simple...
later i want to make a function where u can enable and disable it....
and when there is an aimboter or obvious wallhacker, u just enable it and that would = hacker gets trolled.... and he would leave..
its more troll plugin i guess.

(09-01-2012, 09:40)Pozzuh Wrote: Go to your build settings and allow unsafe code.
sorry, i don't know how to do that,, can u please show me where i add it?? Tongue

(09-01-2012, 10:18)archit Wrote: A much better alternative would be to set the health to -1. This way you can control who becomes god and who doesn't.A wild guess but if you are working in 64 bit environment check the target CPU it should be x86
wouldn't that just make everyone die super fast???
-1 health
i dont really understand since im still a supernoob in c#

(09-01-2012, 09:40)Pozzuh Wrote: Go to your build settings and allow unsafe code.
FACEPALM.. thanx i got it now Smile
Reply

#5
Can I ask what you are patching there exactly (WPM)?
[Image: azuw.jpg]
Reply

#6
omg lol,, idk,
i finally compiled the plugin under net framework 3.0 and i tested it, but it didnt work.
i dont know what i did wrong. any suggestions?

(09-01-2012, 17:23)zxz0O0 Wrote: Can I ask what you are patching there exactly (WPM)?
wait i mean,, im trying to increase the health to the most 99999 i can do so it will become godmode..

and one thinng i was wondering...
what is the difference between
int oP;
byte[] bytes = { 0x90, 0x90 };
and
byte[] bytes = { 0xD9, 0x05, 0xD8, 0xFC, 0x76, 0x00 };
its that for like the cpu usage???
Reply

#7
!safe hackers_nickname

Give everyone godmode except the hacker (name: "hackers_nickname"), nice idea.
Reply

#8
(09-01-2012, 22:19)surtek Wrote: !safe hackers_nickname

Give everyone godmode except the hacker (name: "hackers_nickname"), nice idea.
i still didnt get the plugin working...
does anyone know the dvar name for bullet damage???
i was thinking if i lower is all the way,, it would take forever to kil someone...
can anyone give me a heads up on what i am doing wrong????
it should work,,, i get the message that the plugin is working,, but it doesnt,,,

(09-01-2012, 22:19)surtek Wrote: !safe hackers_nickname

Give everyone godmode except the hacker (name: "hackers_nickname"), nice idea.
i still didnt get the plugin working...
does anyone know the dvar name for bullet damage???
i was thinking if i lower is all the way,, it would take forever to kil someone...
can anyone give me a heads up on what i am doing wrong????
it should work,,, i get the message that the plugin is working,, but it doesnt,,,
Reply

#9
Sorry man, I'm very glad that you love working with the addon but we will not - and don't want to - help you because you're using a older version which means you're using a pirated version.

This thread has been moved to the boards archive.
Contact a moderator in case you want to contribute to this thread.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 4,173 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,751 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 41,668 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 5,683 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 5,190 10-19-2013, 06:59
Last Post: iRoNinja
  [Release] Yurio Map Plugin Yurio 101 62,374 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 18,663 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,714 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,330 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Search Plugin Fluid Killcam N3xT_974 1 3,072 09-10-2013, 20:27
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
1 Guest(s)

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