Hello, why my samp crash (on spawn) when I try this?:
Код:
bool CALLBACK Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
if (SUCCEEDED(SF->getRender()->BeginRender()))
{
int vehicles = SF->getSAMP()->getVehicles()->iVehicleCount;
for (int i = 0; i < vehicles; i++)
{
float vPos[3];
SF->getCLEO()->SetLocalVar(1, (float)i); //Car ID
SF->getCLEO()->SetLocalVar(2, vPos[0]); //X
SF->getCLEO()->SetLocalVar(3, vPos[1]); //Y
SF->getCLEO()->SetLocalVar(4, vPos[2]); //Z
SF->getCLEO()->callOpcode("00AA: store_car 1@ position_to 2@ 3@ 4@"); //Store
float *rvPos[2];
SF->getGame()->convert3DCoordsToScreen(vPos[0], vPos[2], vPos[3], rvPos[0], rvPos[1]);
SF->getRender()->DrawBox((int)rvPos[0], (int)rvPos[1], 25, 25, D3DCOLOR_ARGB(255, 0, 255, 0));
}
SF->getRender()->EndRender();
};
return true;
};