unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > First-Person Shooters > Other FPS Games > Crysis

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2010, 08:45 PM
disco disco is offline
Administrator
 
Join Date: Feb 2010
Posts: 271
Default Crysis CrossHair using SDK

Posted by Kozmo.



Hello,

I thought I would share this simple Crosshair. As with FarCry, there is a SDK available for Crysis. This SDK will save you weeks of reversing, so use it!

Google Crytek Crysis SDK

I wont go into on how to get the games struct pointers this time. Unlike FarCry there is no Draw2dLine function. So we have to make our own.
On the 2 draw functions I provided, you may want to check for null pointers before trying to use them. This was just a spliced together example of how
to draw 2d lines /spheres

Code:
Code:
//This Section Should be Inited Just once
int screenx,screeny,width,height;
mySystem = myFramework->GetISystem();
IRenderer *pIRenderer = ( IRenderer *)mySystem->GetIRenderer();
pIRenderer->GetViewport(&screenx,&screeny,&width,&height);
//get dead center
float ScreenCenterX = (float)width / 2 + screenx;
float ScreenCenterY = (float)height / 2 + screeny;


//This section should go in your main game loop (EndScene will work)
pIRenderer->SetMaterialColor( 1, 1, 1, 0.5f );

Vec3 x(ScreenCenterX-10,ScreenCenterY,0);
Vec3 y(ScreenCenterX+10,ScreenCenterY,0);
draw2Dline(x,y);
x(ScreenCenterX,ScreenCenterY-10,0);
y(ScreenCenterX,ScreenCenterY+10,0);
draw2Dline(x,y);

x(ScreenCenterX,ScreenCenterY,0);
drawCircle(x);
//END of CROSSHAIR


//these are the 2d functions

void draw2Dline(Vec3 x,Vec3 y)
{
Vec3 v3x;
Vec3 v3y;
mySystem->GetIRenderer()->UnProjectFromScreen(x.x,x.y,x.z,&v3x.x,&v3x.y,&v3x.z);
mySystem->GetIRenderer()->UnProjectFromScreen(y.x,y.y,y.z,&v3y.x,&v3y.y,&v3y.z);
mySystem->GetIRenderer()->DrawLine(v3x,v3y);
}
void drawCircle(Vec3 x)
{
Vec3 v3x;
mySystem->GetIRenderer()->UnProjectFromScreen(x.x,x.y,x.z,&v3x.x,&v3x.y,&v3x.z);
mySystem->GetIRenderer()->GetIRenderAuxGeom()->DrawSphere(v3x,.01f,ColorB(255,0,0),true);
}
A pic of the crosshair with Red Dot (pic is not good cuz of my resizing/shrinking etc. crosshair is actually equal in height/width)



Credits: Okidoki for his farcry info
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
crosshair, crysis, sdk

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 08:22 AM.