PostUsing structures

Posts 1–6 of 6 · Page 1 of 1
Using structures
Hello,
Today we are going to discuss how to use structures.

This guides include:
1- What are structs?
2- What does it do?
3- Where can i use it?
4- Is it helpfull?


1- What are structs?
Well,structs are actually?
They are "Objects" with data information in it.
It can be used in DirectX coding,WIN32,Dll,..
They can be used to store data in.
Example:
Code:
struct Player
{
      int Status;
      int rep;
}Player;
So if we use it into a statement it can be used as:
Code:
if(Player.Status)
{
MessageBoxA(NULL, "Succesfully used","Information", NULL); //Our function will be putted in here.
}

if(Player.rep)
{
MessageBoxA(NULL, "Reputation: No rep.","Rep", NULL); //Our function will be putted in here also.
}
2- What does it do?
It basicly execute the function you putted into the struct.
Example:
Code:
struct Example
{
    int jump;
}Example;
So we can use it as the statement:
Code:
if(Example.jump)
{
/*Function*/
Jump(900,200,Jumping_cycle);
}
3- Where can i use it?
You can actually use it anywhere you want.
Like:
1- Game.
2- Program.
3- Anywhere actually.

4- Is it helpfull?
Sure it can.
But you can also use functions like:
Code:
int Status; //Can be used as int Status = 0;
int Rep;     //100
/*This will give the same result as using structs*/
Usage:
Not used:

Code:
int SuperJump;
int NoFallDamage;
int OPK;
int SVP;


if(OPK){...}
If you use it into your hacks:
Code:
struct Player //Now we now it is a player hack
{
int SuperJump;
int NoFallDamage;
int OPK;
int SVP;
}Player;

if(Player.OPK){...} //Here we already now it is a player hack
So Playerhacks can be added imediatly into the PlayerFolder


Hope you like it,have fun on mpgh
dude, you left? :O
Nice // too short
Nice Nice Nice.

But i don't really understand.
What are in the structs ? Only variables ? Or Functions ?

As example, i make a struct for player hacks.
Code:
struct Player{
int x, y, z; ( For SuperJump as exemple )
int recoil;
int speed;
} splayer;
How to do if I want to make the superjump ?
Because we don't define any addys for thoses variables.

If I do :
Code:
player.x += 10; // Superjump
How to increase the height ?
I thought making a function to do that.
Because struct are useless if you do only :
Code:
void sj
{
/* Find playerPointer */
player.x = *(float*)(PlayerPointer+Ofs_x);
player.x += 10;
}
everytime we need to use a variable.

So, can we define what are the variable IN the struct ?
( I ask because I tryed and it failed so, the masked question is how to do ^^ )
At least we need to define what is player.x first, at the begging of the code. Or it should be pointless
Structures are variables, or more like a wrapper for variables. Dunno what I would really call them, I usually like to think of them as some sort of named arrays with each variable having it's own type or something

Just use them as any other variable
Yes.
So, that's not really usefull ^^
Btw, i think i know how to really use them ( Héhé ! :P )

Thx for answer.
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us