Quantcast

Jump to content

» «
Photo

[Q] how to make a CUSTOM cheat in c#? And i more question

23 replies to this topic
Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#1

Posted 07 May 2014 - 02:35 PM

So guyz....hi i am back

I want to know how to make CUSTOM cheats with scripting


And


We do have to compile a .cs mod as .net.dll?????
Is it compulsory?

LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#2

Posted 07 May 2014 - 05:44 PM

So guyz....hi i am back

I want to know how to make CUSTOM cheats with scripting


And


We do have to compile a .cs mod as .net.dll?????
Is it compulsory?

 

the scripthookdotnet can load .cs files no problem. It will compile the code for you. Only if your script depends on resources that would be embedded in the dll is when u would need to compile yourself.

 

also u can make cheats via scripting so you need to be more specific with your question


stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#3

Posted 07 May 2014 - 07:14 PM

do you want cheats, like phone number cheats ?


cp1dell
  • cp1dell

    Ghetto Star

  • Members
  • Joined: 04 Jul 2008

#4

Posted 07 May 2014 - 07:37 PM

I'm assuming that's what he wants. Being able to "add" a new phone number to the game, that when called (or activated after being added to the "Cheats" index) initializes some function that will basically be a cheat code.


pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#5

Posted 07 May 2014 - 09:38 PM

I'm assuming that's what he wants. Being able to "add" a new phone number to the game, that when called (or activated after being added to the "Cheats" index) initializes some function that will basically be a cheat code.

 

If that's it, no, you can't do that with .NET Scripthook.


cp1dell
  • cp1dell

    Ghetto Star

  • Members
  • Joined: 04 Jul 2008

#6

Posted 07 May 2014 - 10:42 PM

Can you do that with anything?


Naru12891
  • Naru12891

    GTA IV Mod Tester

  • Members
  • Joined: 06 May 2014
  • Indonesia

#7

Posted 08 May 2014 - 02:21 AM

if possible. can you make some cheat like in GTA V ;)

Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#8

Posted 08 May 2014 - 05:29 AM

Thank You Guys


Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#9

Posted 08 May 2014 - 05:35 AM

 

I'm assuming that's what he wants. Being able to "add" a new phone number to the game, that when called (or activated after being added to the "Cheats" index) initializes some function that will basically be a cheat code.

 

If that's it, no, you can't do that with .NET Scripthook.

 

Man....... Its Possible I Think


pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#10

Posted 08 May 2014 - 07:17 AM

 

 

I'm assuming that's what he wants. Being able to "add" a new phone number to the game, that when called (or activated after being added to the "Cheats" index) initializes some function that will basically be a cheat code.

 

If that's it, no, you can't do that with .NET Scripthook.

 

Man....... Its Possible I Think

 

From where I am we use to say:

 

   While thinking, a dummy died.

2014-04-10 12:54:57 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.3.0 with C++ Hook version 0.5.1)
2014-04-10 12:56:04 - Direct3D device created!
2014-04-10 12:56:05 - SEARCHING FOR SCRIPTS...
2014-04-10 12:56:05 - DONE! No DotNet script found!


2014-04-10 12:56:05 - INFO: Phone number checks are not available!

Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#11

Posted 08 May 2014 - 07:22 AM

 

 

 

I'm assuming that's what he wants. Being able to "add" a new phone number to the game, that when called (or activated after being added to the "Cheats" index) initializes some function that will basically be a cheat code.

 

If that's it, no, you can't do that with .NET Scripthook.

 

Man....... Its Possible I Think

 

From where I am we use to say:

 

   While thinking, a dummy died.

2014-04-10 12:54:57 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.3.0 with C++ Hook version 0.5.1)
2014-04-10 12:56:04 - Direct3D device created!
2014-04-10 12:56:05 - SEARCHING FOR SCRIPTS...
2014-04-10 12:56:05 - DONE! No DotNet script found!


2014-04-10 12:56:05 - INFO: Phone number checks are not available!

Yeah got it


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#12

Posted 08 May 2014 - 02:39 PM

 

I'm assuming that's what he wants. Being able to "add" a new phone number to the game, that when called (or activated after being added to the "Cheats" index) initializes some function that will basically be a cheat code.

 

If that's it, no, you can't do that with .NET Scripthook.

 

it works on windows xp


pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#13

Posted 08 May 2014 - 04:05 PM Edited by pedro2555, 08 May 2014 - 04:36 PM.

 

 

I'm assuming that's what he wants. Being able to "add" a new phone number to the game, that when called (or activated after being added to the "Cheats" index) initializes some function that will basically be a cheat code.

 

If that's it, no, you can't do that with .NET Scripthook.

 

it works on windows xp

 

 

Bah.. It even got discontinued last month. I think it is safe to say that Windows XP is the ATM operating system, since everyone practically has, or is in the process, of changing for Windows 7.

 

I'm actually working on the migration from Windows XP to Windows 7 on a major financial agency in Angola.


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#14

Posted 09 May 2014 - 05:17 AM

yeah, i dont know why anyone would want to use xp... i know on the next version of the shdn, the phone checks are fixed for win7


pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#15

Posted 09 May 2014 - 09:17 AM

yeah, i dont know why anyone would want to use xp... i know on the next version of the shdn, the phone checks are fixed for win7

 

For personal users, XP is dead, but for big enterprises is quite a challenge to upgrade everything. Imagine the amount of work needed to reformat every ATM in the world, ATMs still use Windows XP.


Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#16

Posted 09 May 2014 - 02:33 PM

So Can We make a custom cheat like san andreas and other old games....


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#17

Posted 09 May 2014 - 03:25 PM

 

yeah, i dont know why anyone would want to use xp... i know on the next version of the shdn, the phone checks are fixed for win7

 

For personal users, XP is dead, but for big enterprises is quite a challenge to upgrade everything. Imagine the amount of work needed to reformat every ATM in the world, ATMs still use Windows XP.

 

i was just referring to those stubborn people that refuse to upgrade after several years... business yes there can be huge costs to upgrade and can be unnecessary (now it is 100% necessary)


So Can We make a custom cheat like san andreas and other old games....

you can make whatever u can think of providing it is practical with how the game is designed and if u have the knowledge...

 

Be more specific with your questions because yes people can write scripts that change the "rules" of the game... you already know that though, right? ;)

 

so what are u trying to ask??


Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#18

Posted 09 May 2014 - 04:47 PM

 

 

yeah, i dont know why anyone would want to use xp... i know on the next version of the shdn, the phone checks are fixed for win7

 

For personal users, XP is dead, but for big enterprises is quite a challenge to upgrade everything. Imagine the amount of work needed to reformat every ATM in the world, ATMs still use Windows XP.

 

i was just referring to those stubborn people that refuse to upgrade after several years... business yes there can be huge costs to upgrade and can be unnecessary (now it is 100% necessary)


So Can We make a custom cheat like san andreas and other old games....

you can make whatever u can think of providing it is practical with how the game is designed and if u have the knowledge...

 

Be more specific with your questions because yes people can write scripts that change the "rules" of the game... you already know that though, right? ;)

 

so what are u trying to ask??

 

Can We Make Cheats Like HESOYAM (In gTa ssa) or Leave ME Alone (in gta vc)


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#19

Posted 09 May 2014 - 04:50 PM

 

 

 

yeah, i dont know why anyone would want to use xp... i know on the next version of the shdn, the phone checks are fixed for win7

 

For personal users, XP is dead, but for big enterprises is quite a challenge to upgrade everything. Imagine the amount of work needed to reformat every ATM in the world, ATMs still use Windows XP.

 

i was just referring to those stubborn people that refuse to upgrade after several years... business yes there can be huge costs to upgrade and can be unnecessary (now it is 100% necessary)


So Can We make a custom cheat like san andreas and other old games....

you can make whatever u can think of providing it is practical with how the game is designed and if u have the knowledge...

 

Be more specific with your questions because yes people can write scripts that change the "rules" of the game... you already know that though, right? ;)

 

so what are u trying to ask??

 

Can We Make Cheats Like HESOYAM (In gTa ssa) or Leave ME Alone (in gta vc)

 

im not familiar with mods for san andreas... what do they do?


cp1dell
  • cp1dell

    Ghetto Star

  • Members
  • Joined: 04 Jul 2008

#20

Posted 09 May 2014 - 07:39 PM

He's suggesting that instead of phone number cheat codes (like in IV) you get the letter-string cheats that the PC versions of III, VC, and SA had - where you typed in a word that would activate a cheat.

 

For example, you would hit on your keyboard

 

R O C K E T M A N

 

And that would activate the Jetpack cheat, giving the player the Jetpack.


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#21

Posted 09 May 2014 - 07:51 PM

He's suggesting that instead of phone number cheat codes (like in IV) you get the letter-string cheats that the PC versions of III, VC, and SA had - where you typed in a word that would activate a cheat.

 

For example, you would hit on your keyboard

 

R O C K E T M A N

 

And that would activate the Jetpack cheat, giving the player the Jetpack.

yeah sure, u could bind a console command or design your own way of receiving this kind of input


pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#22

Posted 09 May 2014 - 08:55 PM Edited by pedro2555, 09 May 2014 - 10:34 PM.

 

He's suggesting that instead of phone number cheat codes (like in IV) you get the letter-string cheats that the PC versions of III, VC, and SA had - where you typed in a word that would activate a cheat.

 

For example, you would hit on your keyboard

 

R O C K E T M A N

 

And that would activate the Jetpack cheat, giving the player the Jetpack.

yeah sure, u could bind a console command or design your own way of receiving this kind of input

 

 

That's actually a very cleaver idea, here is an untested mock up:

public class mainScript : Script
{
	string sequence = "SEQUENCE"; // Set your sequence here
	string playerInput = "";
	public mainScript()
	{
		this.KeyDown += (object sender, KeyEventArgs e) =>
		{
			playerInput += e.Key.ToString().ToUpper();
			if (playerInput == sequence.ToUpper())
				OnSequencePress(ref playerInput);
			else if (!sequence.ToUpper().StartsWith(playerInput))
				playerInput = "";
		};
	}
	void OnSequencePress(ref string _sequence)
	{
		_sequence = "";
		// Do cheaty stuff
	}
}
  • LordOfTheBongs likes this

LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#23

Posted 09 May 2014 - 11:12 PM Edited by LordOfTheBongs, 10 May 2014 - 08:28 PM.

namespace KeySequenceCheats
{
    using System;
    using GTA;

    public class Main : Script
    {
        private const string BURN_ALL_PEDS = "BURN";
        private const string TELEPORT_WP = "WPOINT";
        //add more cheat sequences to trigger code that you add in a new case in switch block below
        //use uppercase only for string values

        private string currentSequence;

        public Main()
        {
            currentSequence = "";

            KeyDown += (o, e) =>
            {
                currentSequence += e.Key.ToString();
                Game.DisplayText("Current Sequence: " + Environment.NewLine + currentSequence, 750);

                switch (currentSequence)
                {
                    case BURN_ALL_PEDS: foreach (Ped p in World.GetAllPeds()) if (Game.Exists(p) && p != Game.LocalPlayer.Character) p.isOnFire = true; break;
                    case TELEPORT_WP: if (Game.Exists(Game.GetWaypoint())) Game.LocalPlayer.TeleportTo(Game.GetWaypoint().Position.ToGround()); break;
                    //add more cases for your cheat code u add

                    default:
                        if (currentSequence == BURN_ALL_PEDS.Substring(0, Math.Min(currentSequence.Length, BURN_ALL_PEDS.Length))) return;
                        if (currentSequence == TELEPORT_WP.Substring(0, Math.Min(currentSequence.Length, TELEPORT_WP.Length))) return;
                        //add checks for each cheat sequence to track if the cheat is being typed in and return so u dont clear it

                        break;
                }

                currentSequence = "";//clears once a cheat is activated or a sequence is broken
            };
        }
    }
}

i got bored and made a couple cheats in a slightly different input checker... basically u are limited to what u can do by your creativity and u can probably do this same thing 100 other ways

 

btw this is untested and im curious if it even works, someone can test ;)

 

edit: tested and works :D

  • pedro2555 likes this

LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#24

Posted 10 May 2014 - 08:29 PM

needed to update the script... uppercase values needed to be used for the string sequences

 

if anyone wants to use in their project, ask permission first and ill gladly let u use... *cough Sharing Golak Asshole *cough *cough





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users