a code that i started on but cant finnish it becouose i just started on c++

#include "DirectX.h"
#include "DayZ.h"

IDirect3D9Ex* p_Object = 0;
IDirect3DDevice9Ex* p_Device = 0;
D3DPRESENT_PARAMETERS p_Params;

ID3DXLine* p_Line;
ID3DXFont* pFontSmall = 0;

Player pPlayer;
LocalPlayer lPlayer;
World2Screen screen;

int CrosshairWidth = Width / 2;
int CrosshairHeight = Height / 2;

char cDist[32];
char cName[32];

int D3D9XInit(HWND hWnd)
{
if (FAILED(Direct3DCreate9Ex(D3D_SDK_VERSION, &p_Object)))
exit(1);

ZeroMemory(&p_Params, sizeof(p_Params));
p_Params.Windowed = TRUE;
p_Params.SwapEffect = D3DSWAPEFFECT_DISCARD;
p_Params.hDeviceWindow = hWnd;
p_Params.MultiSampleQuality = D3DMULTISAMPLE_NONE;
p_Params.BackBufferFormat = D3DFMT_A8R8G8B8;
p_Params.BackBufferWidth = Width;
p_Params.BackBufferHeight = Height;
p_Params.EnableAutoDepthStencil = TRUE;
p_Params.AutoDepthStencilFormat = D3DFMT_D16;

if (FAILED(p_Object->CreateDeviceEx(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &p_Params, 0, &p_Device)))
exit(1);

if (!p_Line)
D3DXCreateLine(p_Device, &p_Line);
//p_Line->SetAntialias(1); *removed cuz crosshair was blurred*

D3DXCreateFont(p_Device, 18, 0, 0, 0, false, DEFAULT_CHARSET, OUT_CHARACTER_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Calibri", &pFontSmall);

return 0;
}

int DrawingPart()
{
p_Device->Clear(0, 0, D3DCLEAR_TARGET, 0, 1.0f, 0);
p_Device->BeginScene();

if (tWnd == GetForegroundWindow())
{
//text with shadow
DrawShadowString("Bf2 spammer - f - SRC", 10, 10, 240, 240, 250, pFontSmall);

if (ReadLocalPlayerEntity(&lPlayer))
{
if (UpdateMatrices(&screen))
{
NoRecoil(&lPlayer);

int pSize = pPlayer.pEntityArraySize;

//Loop for each player
for (int i = 0; i <= pSize; i++)
{
if (ReadPlayerEntity(&pPlayer, i))
{
if (pPlayer.pEntityObject == lPlayer.lPlayer) continue;

int distance = getDistance3D(lPlayer.lFoodPosition.x, lPlayer.lFoodPosition.y, lPlayer.lFoodPosition.z, pPlayer.pFoodPosition.x, pPlayer.pFoodPosition.y, pPlayer.pFoodPosition.z);

D3DXVECTOR3 food = pPlayer.pFoodPosition;
D3DXVECTOR3 head = pPlayer.pHeadPosition;

food = WorldToScreen(&screen, food);
head = WorldToScreen(&screen, head);

float Height = abs(food.y - head.y);
float Width = Height / 2.3;

std::string Type(pPlayer.pEntityTypeName);

if (food.z > 0.01)
{
if (Type == "soldier" && pPlayer.pIsDead != 1 && distance <= 1000)//Player
{

DrawBox(food.x - (Width / 2), food.y - Height, Width, Height, 1, 255, 0, 0, 255);

sprintf(cName, "Player");
DrawString(cName, food.x, food.y, 255, 0, 0, pFontSmall);

sprintf(cDist, "%dm", distance);
DrawString(cDist, food.x, food.y + 12, 255, 0, 0, pFontSmall);



if (Type == "zombie" && distance <= 300)//Zombie
{


DrawBox(food.x - (Width / 2), food.y - Height, Width, Height, 1, 255, 140, 0, 255);

sprintf(cName, "Zombie");
DrawString(cName, food.x, food.y, 255, 140, 0, pFontSmall);

sprintf(cDist, "%dm", distance);
DrawString(cDist, food.x, food.y + 12, 255, 140, 0, pFontSmall);

}

if (Type == "soldier" && pPlayer.pIsDead == 1 && distance <= 1000)//Dead Player
{

sprintf(cName, "Dead Player", distance);
DrawString(cName, food.x, food.y, 255, 255, 255, pFontSmall);

sprintf(cDist, "%dm", distance);
DrawString(cDist, food.x, food.y + 12, 255, 255, 255, pFontSmall);

}

}

}
}
}
}
//crosshair
FillRGB(CrosshairWidth - 3, CrosshairHeight + 6, 21, 1, 255, 20, 147, 255);
FillRGB(CrosshairWidth + 7, CrosshairHeight - 4, 1, 21, 255, 20, 147, 255);
}

p_Device->EndScene();
p_Device->PresentEx(0, 0, 0, 0, 0);
return 0;
}









> DirectX.cpp
1>DirectX.cpp(145): fatal error C1075: end of file found before the left brace '{' at 'DirectX.cpp(50)' was matched
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Last edited on
Please use code tags, makes it much easier to read and it says that your error is on line 50.
Topic archived. No new replies allowed.