- 252
- 217
как перевести координаты скина указанного игрока по id в экранные?
Код:
float enpos[3];
float screen[2];
switch (SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->bytePlayerState)
{
case PLAYER_STATE_ONFOOT:
enpos[0] = SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[0]; // X
enpos[1] = SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[1]; // Y
enpos[2] = SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[2]; // Z
break;
case PLAYER_STATE_DRIVER:
enpos[0] = SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->inCarData.fPosition[0]; // X
enpos[1] = SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->inCarData.fPosition[1]; // Y
enpos[2] = SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->inCarData.fPosition[2]; // Z
break;
case PLAYER_STATE_PASSENGER:
enpos[0] = SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->passengerData.fPosition[0]; // X
enpos[1] = SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->passengerData.fPosition[1]; // Y
enpos[2] = SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->passengerData.fPosition[2]; // Z
break;
}
SF->getGame()->convert3DCoordsToScreen(enpos[0], enpos[1], enpos[2], &screen[0], &screen[1]);