Ok hello C++ gurus Im here to learn C++ and cprogramming is really helping me with the basics. Once I feel comfortable maybe I can pick up a book or two on C++. My main reason for learning C++ is for clienthooking for games. Finding the offsets and reversing the functions so u can hook to the client and do anything u want, such as drawing text, and rendering the playermodels or creating a aimbot so the crosshair automatically locks on to the enemy
Tutorials Used: [Thank you Cprogramming.com maybe I should make a C++ Blog hmmm.]
Code:
Intro to C++ The basics of C+
Loops in C++
Functions Functions...all about them, making and using the critters
Strings About character arrays
Source Code:
Code:
#include "stdafx.h"
#include <iostream> // preprocessor file so we can use functions from iostream
using namespace std; //this tells the compiler to use a group of functions that are apart of the library std. enables us to use functions such as cout and cin.
void getplayers(); // define the function............we have it.
int player; // a int which will hold how many players are on the server
int main() //the main function where the program starts at.
{
char serverip[16]; // a string that will hold 16 characters.. A IP address can be no longer than 16 chars ex. 111.111.111.111 so we dont need anymore
cout<<"Enter the IP im connecting to:"; // used to output text.
cin>> serverip; // read a value into serverip etc the IP
cin.ignore(); // function that reads and discards a character.
cout<<"Connecting to "<< serverip <<"\n";
cin.get(); //runs in input and expects the user to hit the return key.
cout<<"Finding Players..";
cout<<"\n"; //clear a new line \n is not working on the outcall so lets just make a clear line so the last line is not caught up with the display of players.. cheap fix I guess but it works.
getplayers(); //time to call in the function
}
void getplayers() // a simple function
{
for (int x = 0;x < 10; x++) // a simple loop, lets loop intill we find all the players on the server.
{
cout<<"Player "<< x <<endl; //output the player and his ID ex. Player 1
player++; //since this is going to loop intill int x is equal to 10 lets just add it.
}
cin.get();
cout<<"There are " << player <<" players on this server.";
cin.ignore();
}