Results 1 to 5 of 5
  1. #1
    reavenz's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    0

    Post Coding A Game Trainer In C++

    i new in C++
    before i can make game trainer in vb.net & vb6
    but now i want to learn C++

    because vb.net & vb6 not have timer in accurate.
    i think C++ have it..

    please teach me how to make multiplayer game online trainer or please give me some source code..
    and i want to learn it..
    thanks for ur attention and ur help

    Best Regards

  2. #2
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Learn C++ properly first. I doubt you even know basics of C++.

  3. #3
    reavenz's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    0
    many code in C++ so confused with special character ==a
    LoL

    i only want make game trainer..
    :P

  4. #4
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    /FP. Learn C++ before making game trainers !

  5. #5
    phuocdai11's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    1
    i have source game snake :
    you can look! it make from oop! compile DEVC++
    Code:
    //ball.cpp
    #include "balls.h"
    #include "myfunc.h"
    
    balls::balls(int m, int n,int c){
    	maxx = n;
    	maxy = m;
    	color = c;
    	time(&time_begin);
    }
    //==============================================================================
    void balls::print(){
    	time_t t;
    	time(&t);
    	int x1 = toado.x * 11 - 6;
    	int y1 = toado.y * 11 - 6;
    	print_rectangle(toado.x,toado.y,11,0);
    	if ( (t-time_begin)%2 == 0 ) { 
    		putpixel(x1,y1,color);
    		putpixel(x1,y1-3,color);putpixel(x1,y1-2,color);
    		putpixel(x1,y1+1,color);putpixel(x1,y1+2,color);
    		putpixel(x1,y1+3,color);putpixel(x1,y1-1,color);
    		putpixel(x1-3,y1,color);putpixel(x1-2,y1,color);
    		putpixel(x1-1,y1,color);putpixel(x1+1,y1,color);
    		putpixel(x1+2,y1,color);putpixel(x1+3,y1,color);
    	}
    	else print_rectangle(toado.x,toado.y,9,color);
    }
    //==============================================================================
    void balls::set(snakes snake,walls wall){
    	int x,y;
    	bool ok = true;
    	while (ok){
    		ok = false;
    		x = random(2,maxx-1);
    		y = random(2,maxy-1);
    		for (int i=0; i<snake.get_leng();i++){
    			nude p=snake.get(i);
    				if ((x == p.x)&&(y == p.y)) ok = true;
    		}
    		if (wall.get(x,y)) ok = true;
    	}
    	toado.x = x;
    	toado.y = y;
    }
    //==============================================================================
    nude balls::get(){
    	return toado;
    }
    //ball.h
    #ifndef BALLS_H
    #define BALLS_H
    #include "myfunc.h"
    #include "snakes.h"
    
    class balls{
    private:
    	nude toado;
    	time_t time_begin;
    	int maxx,maxy;
    	int color;
    public:
    	balls(int m, int n,int color);
    	void print();
    	void set(snakes,walls);
    	nude get();
    };
    #endif
    //myfunction.cpp
    #include "myfunc.h"
    //==============================================================================
    void print_rectangle(int i,int j,int n,int color){
    	setcolor(color);
    	for (int k=0;k<n;k++)
    		line(i*11-11,j*11-11+k,i*11-12+n,j*11-11+k);
    }
    //==============================================================================
    void print_hcn(int x,int y,int row,int col,int n){
    	for (int i=0;i<=n;i++){
    		line(x+i,y,x+i,y+row);
    		line(x+col+i,y,x+col+i,y+row);
    		line(x,y+i,x+col,y+i);
    		line(x,y+i+row,x+col+n,y+i+row);
    	}
    }
    //==============================================================================
    void text(char *p,int n){
    	int len = 0;
    	char str[10];
    	while (n>0){
    		str[len] = (char)(n%10+48);
    		n = n/10;
    		len++;
    	}
    	str[len] = 0;
    	for (int i=0; i<len/2; i++){
    		char kt = str[i];
    		str[i] = str[len-1-i];
    		str[len-1-i] = kt;
    	}
    	strcpy(p,str);
    }
    int random(int a,int b){
    	return ((rand() % (b-a+1))+a);
    }
    //myfunction.h
    #ifndef MYFUNC_H
    #define MYFUNC_H
    
    #include <iostream>
    #include <windows.h>
    #include <graphics.h>
    #include <math.h>
    #include <time.h>
    #include <string.h>
    #include <stdlib.h>
    #include <conio.h>
    
    void print_rectangle(int i,int j,int n,int color);
    void text(char *p,int n);
    void print_hcn(int x,int y,int row,int col,int n);
    int random(int a, int b);
    
    using namespace std;
    struct nude{
    	int x,y;
    };
    
    #endif
    //snake.cpp
    #include "snakes.h"
    #include "myfunc.h"
    
    snakes::snakes(int c){
    	color = c;
    }
    //==============================================================================
    void snakes::print(){
    	print_rectangle(p[leng].x,p[leng].y,9,0);
    	for (int i=0; i<leng;i++)
    		print_rectangle(p[i].x,p[i].y,9,color);
    }
    //==============================================================================
    void snakes::print_die1(){
    	for (int j=1;j<=3; j++){
    		for (int i=0; i<leng;i++)
    			print_rectangle(p[i].x,p[i].y,9,color);
    		delay(500);
    		for (int i=0; i<leng;i++)
    			print_rectangle(p[i].x,p[i].y,9,0);
    			print_rectangle(p[0].x,p[0].y,11,14);
    		delay(500);
    	}
    }
    //==============================================================================
    void snakes::print_die2(){
    	for (int j=1;j<=3; j++){
    		for (int i=0; i<leng;i++)
    			print_rectangle(p[i].x,p[i].y,9,color);
    		delay(500);
    		for (int i=0; i<leng;i++)
    			print_rectangle(p[i].x,p[i].y,9,0);
    		delay(500);
    	}
    }
    //==============================================================================
    void snakes::moveup(){
    	for (int i= leng; i>0; i--){
    		p[i].x = p[i-1].x;
    		p[i].y = p[i-1].y;
    	}
    	huong = 1;	
    	p[0].y--; 
    }
    //==============================================================================
    void snakes::moveright(){
    	for (int i= leng; i>0; i--){
    		p[i].x = p[i-1].x;
    		p[i].y = p[i-1].y;
    	}
    	huong = 2;
    	p[0].x++; 
    }
    //==============================================================================
    void snakes::movedown(){
    	for (int i= leng; i>0; i--){
    		p[i].x = p[i-1].x;
    		p[i].y = p[i-1].y;
    	}
    	huong = 3;
    	p[0].y++; 
    }
    //==============================================================================
    void snakes::moveleft(){
    	for (int i= leng; i>0; i--){
    		p[i].x = p[i-1].x;
    		p[i].y = p[i-1].y;
    	}
    	huong = 4;
    	p[0].x--; 
    }
    //==============================================================================
    void snakes::goahead(){
    	for (int i= leng; i>0; i--){
    		p[i].x = p[i-1].x;
    		p[i].y = p[i-1].y;
    	}
    	int h[5][2]={{0,0},{0,-1},{1,0},{0,1},{-1,0}};
    	p[0].x  += h[huong][0];
    	p[0].y  += h[huong][1];
    }
    //==============================================================================
    bool snakes::eat(nude b){
    	if ((p[0].x == b.x)&&(p[0].y == b.y)){
    			leng ++;
    			return true;
    	}
    	else return false;
    }
    //==============================================================================
    void snakes::set(int max, int h){
    	leng = 4;
    	p[0].y = p[1].y = p[2].y = p[3].y = 2;
    	for (int i=0; i<4; i++) p[i].x = (5-i);
    	maxleng = max;
    	huong = h;
    }
    //==============================================================================
    bool snakes::die(){
    	for (int i=0; i<leng; i++)
    		for (int j=i+1; j<leng; j++)
    			if ((p[i].x==p[j].x)&&(p[i].y==p[j].y)&&(i!=j))
    					return true;
    	return false;
    }
    //==============================================================================
    bool snakes::die(walls wall){
    	if (wall.get(p[0].x,p[0].y)) return true;
    	return false;
    }
    //==============================================================================
    nude snakes::get(int i){
    	return p[i];
    }
    //==============================================================================
    int snakes::get_huong(){
    	return huong;
    }
    //==============================================================================
    int snakes::get_leng(){
    	return leng;
    }
    //snake.h
    #include "myfunc.h"
    #include "walls.h"
    
    #ifndef SNAKES_H
    #define SNAKES_H
    
    class snakes{
    private:
    	nude p[50];
    	int x,y;
    	int leng ;//Do dai thuc cua ran
    	int maxleng;//Do dai toi da cua ran
    	int huong;//Huong chuyen dong cua ran
    	int color;
    public:
    	snakes(int color);
    	void print();//Ve con ran
    	void print_die1();//Ve con ran khi chet' do dam vao tuong
    	void print_die2();//Ve con ran khi chet' do dam vao chinh no
    	void moveup();//Con ran di len
    	void moveright();
    	void movedown();
    	void moveleft();
    	void goahead();//Con ran di thang
    	bool eat(nude);
    	void set(int,int);//Dinh huong con ran
    	nude get(int i);//Tra lai toa do cua p[i]
    	int get_huong();//Lay huong cua ran
    	int get_leng(); //Lay do dai cua ran
    	bool die();
    	bool die(walls);//Kiem tra chet d
    };
    #endif
    //wall.cpp
    #include "walls.h"
    
    //==============================================================================
    walls::walls(int m, int n, int c){
    		row = m;
    		col = n;
    		color = c;
    }
    //==============================================================================
    void walls::refresh(){
    	for (int i=2;i<30;i++)
    		for (int j=2;j<30;j++)
    			print_rectangle(i,j,11,0);
    }
    //==============================================================================
    void walls::set1(){
    	for (int i=1; i<=row; i++)
    			for (int j=1; j<=col; j++)
    				if ((i>1)&&(i<row)&&(j>1)&&(j<col)) w[i][j] = 0;
    				else w[i][j] = 1;
    }
    //==============================================================================
    void walls::set2(){
    	set1();
    	for (int i=5;i<=10;i++)
    		for (int j=5;j<=10; j++) w[i][j] = 1;
    	for (int i=5;i<=10;i++)
    		for (int j=20;j<=25;j++) w[i][j] = 1;
    	for (int i=20;i<=25;i++)
    		for (int j=5;j<=10;j++) w[i][j] = 1;
    	for (int i=20;i<=25;i++)
    		for (int j=20;j<=25;j++) w[i][j] = 1;
    }
    //==============================================================================
    void walls::set3(){
    	set1();
    	for (int j=5;j<=25;j++)
    		if (j%5==0){
    			for (int i=1;i<=9;i++) w[i][j]=1;
    			for (int i=21;i<=29;i++) w[i][j]=1;
    	}
    }
    //==============================================================================
    void walls::set4(){
    	set1();
    	for (int i=5;i<=25;i++)
    		for (int j=5;j<=25;j++)
    			if ((i%5==0)&&(j%5==0)) w[i][j]=1;
    }
    //==============================================================================
    void walls::set5(){
    	set1();
    	for (int j=5;j<=25;j++){
    		w[10][j] = 1;
    		w[20][j] = 1;
    	}
    	for (int i=5;i<=9;i++){
    		w[i][5] = 1;
    		w[i][25] = 1;
    	}
    	for (int i=21;i<=25;i++){
    		w[i][5] = 1;
    		w[i][25] = 1;
    	}
    }
    //==============================================================================
    void walls::set6(){
    	set1();
    	for (int j=5;j<=26;j++){
    		w[15][j] = 1;
    		w[16][j] = 1;
    	}
    	for (int i=5;i<=26;i++){
    		w[i][15] = 1;
    		w[i][16] = 1;
    	}
    }
    //==============================================================================
    void walls::set7(){
    	set1();
    	for (int i=5;i<=15;i++){
    		w[i][5] = 1;
    		w[26][i] = 1;
    	}
    	for (int i=16;i<=26;i++){
    		w[5][i] = 1;
    		w[i][26] = 1;
    	}
    	for (int i=5;i<=26;i++){
    		w[i][15] = w[i][16] = 1;
    		w[15][i] = w[16][i] = 1;
    	}
    }
    //==============================================================================
    void walls::set8(){
    	set1();
    	for (int i=7;i<=24;i++){
    		w[24][i] = 1;
    		w[7][i] = 1;
    		w[i][24] = 1;
    	}
    	for (int i=13;i<=18;i++){
    		w[13][i] = 1;
    		w[18][i] = 1;
    		w[i][7] = 1;
    	}
    }
    //==============================================================================
    void walls::set9(){
    	set1();
    	for (int i=5;i<=10;i++){
    		w[5][i] = 1;
    		w[26][i] = 1;
    	}
    }
    //==============================================================================
    void walls::set10(){
    	set1();
    }
    //==============================================================================
    void walls::set(int map){
    	if (map==1)	set1();
    	else if (map==2) set2();
    	else if (map==3) set3();
    	else if (map==4) set4();
    	else if (map==5) set5();
    	else if (map==6) set6();
    	else if (map==7) set7();
    	else if (map==8) set8();
    	else if (map==9) set9();
    	else if (map==10) set10();
    }
    //==============================================================================
    void walls::print(){
    		for (int i=1; i<=col; i++)
    			for (int j=1; j<=row; j++)
    				if (w[i][j])
    					print_rectangle(i,j,11,color);
    }
    //==============================================================================
    int walls::get(int i,int j){
    	return w[i][j];
    }
    //walls.h
    #ifndef WALLS_H
    #define WALLS_H
    #include "myfunc.h"
    
    class walls{
    private:
    	char w[100][100];
    	int row,col;
    	int color;
    public:
    	walls(int m,int n,int color);//Sinh ra buc tuong mxn
    	void refresh();
    	void set(int map);
    	void set1();
    	void set2();
    	void set3();
    	void set4();
    	void set5();
    	void set6();
    	void set7();
    	void set8();
    	void set9();
    	void set10();
    	void print();//In ra buc tuong mxn
    	int get(int i,int j);//Lay gia tri cua o a[i][j]
    };
    #endif
    source congdongcvie*****m
    coder: metal_shield
    //
    ok i finish it.this is sample code game in c++ with oop.I hope it can help you know some thing about c++... good luck to u!

  6. The Following User Says Thank You to phuocdai11 For This Useful Post:

    flameswor10 (12-25-2011)

Similar Threads

  1. [Request] EASY FLASH GAME TRAINER
    By crepern123 in forum Hack Requests
    Replies: 2
    Last Post: 10-12-2009, 11:36 PM
  2. Element trading card game trainer
    By anticreeps in forum General Game Hacking
    Replies: 1
    Last Post: 10-07-2009, 10:47 PM
  3. [HELP] Codes in game moving around after update
    By mynameisjack in forum General Game Hacking
    Replies: 3
    Last Post: 06-03-2009, 10:44 PM
  4. i need help making a in game trainer HELP
    By dethklok6661 in forum General Game Hacking
    Replies: 0
    Last Post: 01-21-2009, 05:35 PM
  5. Writing Stamina Code Vb6 ???done Trainer
    By jokuvaan11 in forum WarRock - International Hacks
    Replies: 5
    Last Post: 06-09-2007, 05:40 AM