Use "%d"

Hello, I am trying to code a stats hack, but whenever I convert the minerals to a char so I cna print them to the screen, SC crashes. here is my code:
Any ideas? ThanksPHP Code:int thr2[500];
void DrawGas()
{
__asm
{
mov ecx, 57F108h
mov ecx, dword ptr [ecx]
mov PlayerGas1, ecx
}
sprintf(thr2, "%s", (char)PlayerGas1);
DrawStaticText(thr2, 17, 50);
}



Use "%d"

Thanks




Your code needs a lot of cleaning up to do. It looks a little rough, imo.
Here's a quick fixup:
#EDIT:Code:static char fmtResources[100]; void DrawGas() { PlayerGas1 = *(int*)0x57F108; sprintf(fmtResources, "%d", PlayerGas1); DrawStaticText(fmtResources, 17, 50); }
Can even condense that to this:
Code:void DrawGas() { static char fmtResources[100]; sprintf(fmtResources, "%d", *(int*)0x57F108); DrawStaticText(fmtResources, 17, 50); }
Case: Antec Nine Hundred
CPU: Intel C2Q Q9650 @ 4.0 GHz (9x445), 1.31v [IntelBurnTest stable]
GPU/Monitor: Visiontek HD 4870 X2 @ 800 MHz/4000 MHz +SyncMaster245BW 24"
Motherboard: ASUS P5Q Deluxe (BIOS 2005)
Memory: 8 GB (4x 2 GB) OCZ Reaper HPC DDR2 1066 @ 1069 MHz
Hard Drive: 2x Seagate 500 GB 7200.11 (Matrix RAID) + 1x WD Caviar Black 640 GB
Sound: Creative SB X-Fi Fatal1ty Pro
PSU: OCZ GameXStream 700W
O/S: Vista Ultimate X64 SP2
Download Apocalypse v4.02 here!
Download EliteControl here!

Thanks again, that is much simpler. I am going to shoove it all into a 2D structure
There are currently 1 users browsing this thread. (0 members and 1 guests)