Post: [All Cod] How To Create A Function/Option That Toggles! [Noob Friendly]
01-12-2014, 02:51 PM #1
ItsMagiicsz
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); Hey guys, this is a really quick release.
I am only sharing this with you guys because i cannot explain the amount of times i am asked about this.
I will just be telling you how to toggle an option and how it works Smile.
So lets get started.

Base Of Toggle Function By Me:
    
bool OptionTog;
private void Option(int client)
{
if (OptionTog == false)
{
//Put offsetsandshithere!
OptionTog = true;
}
else
{
//Put offsetsandshithere!
OptionTog = false;
}
}
I have put it like this because i know some of you newbs cannot be bothered to learn what the bool means and where you use it.


Explaining what the function does:
    
bool: this helps you to toggle the shit, remember the option name must be different from the bool name, if they are the same you may get errors as it wont know what one to read.
int client: your just stating the client, you would keep this if your menu was all client, if not it would be ' private void Option() '


How to call the function:
    
To call it is easy!
For an all client menu:
Option(client);

For a host only menu:
Option();

You must put this where the option you would select the option.


An example:
    
bool ChromePlayersTog;
private void ChromePlayers(int client)
{
if (ChromePlayersTog == false)
{
DEX.SetMemory((0x0046C0E8 + ((uint)client * 0x3600)), new byte[] { 0x60, 0x00, 0x00, 0x00 });
ChromePlayersTog = true;
}
else
{
DEX.SetMemory((0x0046C0E8 + ((uint)client * 0x3600)), new byte[] { 0x2C, 0x03, 0x00, 0x00 });
ChromePlayersTog = false;
}
}


Credits:
    
Me - Making da tutorial.
Taylor - Showing me how to make a bool function when i was a little newb.
eddie mac - The Chrome Players Offset.


Enjoy Awesome face
(adsbygoogle = window.adsbygoogle || []).push({});

The following 6 users say thank you to ItsMagiicsz for this useful post:

Azus, iNDMx, Mango_Knife, John, Notorious, xSlinkeyy
01-12-2014, 03:08 PM #2
SnaY
Former Lead of GS
Originally posted by ItsMagiicsz View Post
Hey guys, this is a really quick release.
I am only sharing this with you guys because i cannot explain the amount of times i am asked about this.
I will just be telling you how to toggle an option and how it works Smile.
So lets get started.

Base Of Toggle Function By Me:
    
bool OptionTog;
private void Option(int client)
{
if (OptionTog == false)
{
//Put offsetsandshithere!
OptionTog = true;
}
else
{
//Put offsetsandshithere!
OptionTog = false;
}
}
I have put it like this because i know some of you newbs cannot be bothered to learn what the bool means and where you use it.


Explaining what the function does:
    
bool: this helps you to toggle the shit, remember the option name must be different from the bool name, if they are the same you may get errors as it wont know what one to read.
int client: your just stating the client, you would keep this if your menu was all client, if not it would be ' private void Option() '


How to call the function:
    
To call it is easy!
For an all client menu:
Option(client);

For a host only menu:
Option();

You must put this where the option you would select the option.


An example:
    
bool ChromePlayersTog;
private void ChromePlayers(int client)
{
if (ChromePlayersTog == false)
{
DEX.SetMemory((0x0046C0E8 + ((uint)client * 0x3600)), new byte[] { 0x60, 0x00, 0x00, 0x00 });
ChromePlayersTog = true;
}
else
{
DEX.SetMemory((0x0046C0E8 + ((uint)client * 0x3600)), new byte[] { 0x2C, 0x03, 0x00, 0x00 });
ChromePlayersTog = false;
}
}


Credits:
    
Me - Making da tutorial.
Taylor - Showing me how to make a bool function when i was a little newb.
eddie mac - The Chrome Players Offset.


Enjoy Awesome face


You are a little noob :p :carling:

You must login or register to view this content. :p

The following 6 users say thank you to SnaY for this useful post:

ItsMagiicsz, John, VezahMoDz, Hash847, xRaW
01-12-2014, 03:22 PM #3
ItsMagiicsz
Bounty hunter
Originally posted by SnaY View Post
You are a little noob :p :carling:


lel <3
01-12-2014, 04:17 PM #4
Source Code
Bounty hunter
Cool release for the c# nooblets :derp:

The following 2 users say thank you to Source Code for this useful post:

ItsMagiicsz, SnaY
01-12-2014, 04:58 PM #5
I recommend you to read from memory to know what the state of the mod is.


    
void mFlag(int client)//toggle between multiple options
{
int mFlag = PS3Lib.ReadInt32(playerState(client) + 0x3214);
mFlag++;
mFlag %= 5;
PS3Lib.WriteInt32(playerState(client) + 0x3214, mFlag);
}

void God(int client)//toggle between two options
{
int god = PS3Lib.ReadInt32(gEntity(client) + 0x1ACool Man (aka Tustin);
PS3Lib.WriteInt32(gEntity(client) + 0x1A8, (god != 100 ? 100 : 0x7FFFFFFF));
}

uint playerState(int client)
{
return (uint)(0xF12C80 + 0x3600 * client);
}

uint gEntity(int client)
{
return (uint)(0xDD2C80 + 0x280 * client);
}

The following 5 users say thank you to therifboy for this useful post:

$ticky, ErasedDev, ImSooCool, ItsLollo1000, VezahMoDz
01-12-2014, 05:06 PM #6
ItsLollo1000
Little One
Originally posted by therifboy View Post
I'd recommend you to read from memory to know what the state of the mod is.


    
void mFlag(int client)//toggle between multiple options
{
int mFlag = PS3Lib.ReadInt32(playerState(client) + 0x3214);
mFlag++;
mFlag %= 5;
PS3Lib.WriteInt32(playerState(client) + 0x3214, mFlag);
}

void God(int client)//toggle between two options
{
int god = PS3Lib.ReadInt32(gEntity(client) + 0x1ACool Man (aka Tustin);
PS3Lib.WriteInt32(gEntity(client) + 0x1A8, (god != 100 ? 100 : 0x7FFFFFFF));
}

uint playerState(int client)
{
return (uint)(0xF12C80 + 0x3600 * client);
}

uint gEntity(int client)
{
return (uint)(0xDD2C80 + 0x280 * client);
}


Magiic these functions are better :$
01-12-2014, 05:09 PM #7
ItsLollo1000
Little One
Originally posted by ItsMagiicsz View Post
Hey guys, this is a really quick release.
I am only sharing this with you guys because i cannot explain the amount of times i am asked about this.
I will just be telling you how to toggle an option and how it works Smile.
So lets get started.

Base Of Toggle Function By Me:
    
bool OptionTog;
private void Option(int client)
{
if (OptionTog == false)
{
//Put offsetsandshithere!
OptionTog = true;
}
else
{
//Put offsetsandshithere!
OptionTog = false;
}
}
I have put it like this because i know some of you newbs cannot be bothered to learn what the bool means and where you use it.


Explaining what the function does:
    
bool: this helps you to toggle the shit, remember the option name must be different from the bool name, if they are the same you may get errors as it wont know what one to read.
int client: your just stating the client, you would keep this if your menu was all client, if not it would be ' private void Option() '


How to call the function:
    
To call it is easy!
For an all client menu:
Option(client);

For a host only menu:
Option();

You must put this where the option you would select the option.


An example:
    
bool ChromePlayersTog;
private void ChromePlayers(int client)
{
if (ChromePlayersTog == false)
{
DEX.SetMemory((0x0046C0E8 + ((uint)client * 0x3600)), new byte[] { 0x60, 0x00, 0x00, 0x00 });
ChromePlayersTog = true;
}
else
{
DEX.SetMemory((0x0046C0E8 + ((uint)client * 0x3600)), new byte[] { 0x2C, 0x03, 0x00, 0x00 });
ChromePlayersTog = false;
}
}


Credits:
    
Me - Making da tutorial.
Taylor - Showing me how to make a bool function when i was a little newb.
eddie mac - The Chrome Players Offset.


Enjoy Awesome face


Also you boolens only work von one client Winky Winky so if someone else tries to turn on godmode he first turns it off or just change your state Winky Winky also fix that
better do functions like this

    
public static Boolean[] ChromePlayersEnabled = new Boolean[12],
public static void DoChromePlayers(Int32 Client, Boolean State)
{
PS3.SetMemory(0x46c0eb, ((State ? new Byte[] { 1 } : new Byte[1])));
RemoteProduceCall.iPrintln(Client, "Chrome Clients : " + ((State ? "^2Enabled" : "^1Disabled")));
FunctionsShit.ChromePlayersEnabled[Client] = State;
}
01-12-2014, 06:53 PM #8
Mango_Knife
In my man cave
Originally posted by ItsMagiicsz View Post
Hey guys, this is a really quick release.
I am only sharing this with you guys because i cannot explain the amount of times i am asked about this.
I will just be telling you how to toggle an option and how it works Smile.
So lets get started.

Base Of Toggle Function By Me:
    
bool OptionTog;
private void Option(int client)
{
if (OptionTog == false)
{
//Put offsetsandshithere!
OptionTog = true;
}
else
{
//Put offsetsandshithere!
OptionTog = false;
}
}
I have put it like this because i know some of you newbs cannot be bothered to learn what the bool means and where you use it.


Explaining what the function does:
    
bool: this helps you to toggle the shit, remember the option name must be different from the bool name, if they are the same you may get errors as it wont know what one to read.
int client: your just stating the client, you would keep this if your menu was all client, if not it would be ' private void Option() '


How to call the function:
    
To call it is easy!
For an all client menu:
Option(client);

For a host only menu:
Option();

You must put this where the option you would select the option.


An example:
    
bool ChromePlayersTog;
private void ChromePlayers(int client)
{
if (ChromePlayersTog == false)
{
DEX.SetMemory((0x0046C0E8 + ((uint)client * 0x3600)), new byte[] { 0x60, 0x00, 0x00, 0x00 });
ChromePlayersTog = true;
}
else
{
DEX.SetMemory((0x0046C0E8 + ((uint)client * 0x3600)), new byte[] { 0x2C, 0x03, 0x00, 0x00 });
ChromePlayersTog = false;
}
}


Credits:
    
Me - Making da tutorial.
Taylor - Showing me how to make a bool function when i was a little newb.
eddie mac - The Chrome Players Offset.


Enjoy Awesome face


I Appriciate the work so i will thank the post :yes:
01-12-2014, 08:13 PM #9
Originally posted by ItsMagiicsz View Post
Hey guys, this is a really quick release.
I am only sharing this with you guys because i cannot explain the amount of times i am asked about this.
I will just be telling you how to toggle an option and how it works Smile.
So lets get started.

Base Of Toggle Function By Me:
    
bool OptionTog;
private void Option(int client)
{
if (OptionTog == false)
{
//Put offsetsandshithere!
OptionTog = true;
}
else
{
//Put offsetsandshithere!
OptionTog = false;
}
}
I have put it like this because i know some of you newbs cannot be bothered to learn what the bool means and where you use it.


Explaining what the function does:
    
bool: this helps you to toggle the shit, remember the option name must be different from the bool name, if they are the same you may get errors as it wont know what one to read.
int client: your just stating the client, you would keep this if your menu was all client, if not it would be ' private void Option() '


How to call the function:
    
To call it is easy!
For an all client menu:
Option(client);

For a host only menu:
Option();

You must put this where the option you would select the option.


An example:
    
bool ChromePlayersTog;
private void ChromePlayers(int client)
{
if (ChromePlayersTog == false)
{
DEX.SetMemory((0x0046C0E8 + ((uint)client * 0x3600)), new byte[] { 0x60, 0x00, 0x00, 0x00 });
ChromePlayersTog = true;
}
else
{
DEX.SetMemory((0x0046C0E8 + ((uint)client * 0x3600)), new byte[] { 0x2C, 0x03, 0x00, 0x00 });
ChromePlayersTog = false;
}
}


Credits:
    
Me - Making da tutorial.
Taylor - Showing me how to make a bool function when i was a little newb.
eddie mac - The Chrome Players Offset.


Enjoy Awesome face


If people don't know how to use basic variables in c# they shouldn't even be making a tool

The following user thanked Black Panther for this useful post:

Shark
01-13-2014, 05:31 AM #10
ImSooCool
Vault dweller
should've also said that Boolean is a datatype which is only gonna return true or false. so people get the idea of it being as a toggler(or whatever)

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo