Попытался сделать получение координат кости и рисовать на них, но чё то не то
В чём ошибка?
C++:
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
#include <windows.h>
#include <string>
#include <assert.h>
#include <process.h>
#define FUNC_IsVisible 0x536BC0
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
SAMPFUNCS *SF = new SAMPFUNCS();
bool CALLBACK Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
if (SUCCEEDED(SF->getRender()->BeginRender())) // если рендерер готов к рисованию
{
for (int i = 0; i < SAMP_MAX_PLAYERS; i++)
{
actor_info *actorInfo = SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->pSAMP_Actor->pGTA_Ped;
CPed* Ped = GAME->GetPools()->GetPed((DWORD*)actorInfo);
float posX[15], posY[15];
int counter = 0;
CVector vPos[15];
for (int i = 1; i <= 53; i++)
{
switch (i)
{
case 1:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 3:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 4:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 5:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 6:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 22:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 23:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 25:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 32:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 33:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 35:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 42:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 43:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 52:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
case 53:
Ped->GetTransformedBonePosition((eBone)i, &vPos[counter]);
counter++;
}
}
if (Ped->IsOnScreen())
{
for (int i = 0; i <= 14; i++) SF->getGame()->convert3DCoordsToScreen(vPos[i].fX, vPos[i].fY, vPos[i].fZ, &posX[i], &posY[i]);
SF->getRender()->DrawLine(posX[0], posY[0], posX[1], posY[1], 2, 0xFFFFFFFF);
SF->getRender()->DrawLine(posX[0], posY[0], posX[11], posY[11], 2, 0xFFFFFFFF);
SF->getRender()->DrawLine(posX[0], posY[0], posX[13], posY[13], 2, 0xFFFFFFFF);
SF->getRender()->DrawLine(posX[1], posY[1], posX[2], posY[2], 2, 0xFFFFFFFF);
SF->getRender()->DrawLine(posX[2], posY[2], posX[5], posY[5], 2, 0xFFFFFFFF);
SF->getRender()->DrawLine(posX[2], posY[2], posX[8], posY[8], 2, 0xFFFFFFFF);
SF->getRender()->DrawLine(posX[2], posY[2], posX[3], posY[3], 2, 0xFFFFFFFF);
SF->getRender()->DrawLine(posX[3], posY[3], posX[4], posY[4], 2, 0xFFFFFFFF);
SF->getRender()->DrawLine(posX[5], posY[5], posX[6], posY[6], 2, 0xFFFFFFFF);
SF->getRender()->DrawLine(posX[6], posY[6], posX[7], posY[7], 2, 0xFFFFFFFF);
SF->getRender()->DrawLine(posX[8], posY[8], posX[9], posY[9], 2, 0xFFFFFFFF);
SF->getRender()->DrawLine(posX[9], posY[9], posX[10], posY[10], 2, 0xFFFFFFFF);
}
SF->getRender()->EndRender(); // завершаем рисование
}
};
return true; // возвращаем положительный результат
};
void CALLBACK mainloop()
{
static bool init = false;
if (!init)
{
if (GAME == nullptr)
return;
if (GAME->GetSystemState() != eSystemState::GS_PLAYING_GAME)
return;
if (!SF->getSAMP()->IsInitialized())
return;
//SF->getSAMP()->registerChatCommand("stillobj", sasas);
init = true;
}
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReasonForCall, LPVOID lpReserved)
{
switch (dwReasonForCall)
{
case DLL_PROCESS_ATTACH:
SF->initPlugin(mainloop, hModule);
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
В чём ошибка?