
25.07.2023, 17:57
|
|
Познавший АНТИЧАТ
Регистрация: 27.11.2020
Сообщений: 1,431
С нами:
2874035
Репутация:
183
|
|
Сообщение от Z3roKwq
давно с сф не работал, получилось, что получилось
C++:
Код:
void
renderPlayers
(
)
{
for
(
int
i
=
0
;
i
getSAMP
(
)
->
getPlayers
(
)
->
isListed
[
i
]
&&
SF
->
getSAMP
(
)
->
getPlayers
(
)
->
remotePlayerInfo
[
i
]
!=
nullptr
&&
i
!=
SF
->
getSAMP
(
)
->
getPlayers
(
)
->
localPlayerInfo
.
id
)
{
CVector myPedPositionWorld
=
*
PEDSELF
->
GetPosition
(
)
;
CVector pedPositionWorld
=
*
reinterpret_cast
(
SF
->
getSAMP
(
)
->
getPlayers
(
)
->
remotePlayerInfo
[
i
]
->
data
->
onFootPos
)
;
CVector myPedPositionScreen
=
ConvertGametoScreen
(
myPedPositionWorld
)
;
CVector pedPositionScreen
=
ConvertGametoScreen
(
pedPositionWorld
)
;
if
(
pedPositionScreen
.
fZ
>
1.f
)
{
ImGui
::
GetBackgroundDrawList
(
)
->
AddLine
(
{
myPedPositionScreen
.
fX
,
myPedPositionScreen
.
fY
}
,
{
pedPositionScreen
.
fX
,
pedPositionScreen
.
fY
}
,
-
1
)
;
}
}
}
}
фунции такой нет ConvertGameToScreen, немного переписал твой код на мой sampfuncs, внимание на 10 строку
C++:
Код:
for
(
int
i
=
0
;
i
getSAMP
(
)
->
getPlayers
(
)
->
remotePlayersInfo
.
isListed
[
i
]
&&
SF
->
getSAMP
(
)
->
getPlayers
(
)
->
remotePlayersInfo
.
remotePlayer
[
i
]
!=
nullptr
&&
i
!=
SF
->
getSAMP
(
)
->
getPlayers
(
)
->
localPlayerInfo
.
id
)
{
CVector myPedPositionWorld
=
*
PEDSELF
->
GetPosition
(
)
;
CVector pedPositionWorld
=
*
reinterpret_cast
(
SF
->
getSAMP
(
)
->
getPlayers
(
)
->
remotePlayersInfo
.
remotePlayer
[
i
]
->
data
->
onFootPos
)
;
CVector2D my
;
CVector2D ped
;
SF
->
getGame
(
)
->
convert3DCoordsToScreen
(
myPedPositionWorld
.
fX
,
myPedPositionWorld
.
fY
,
myPedPositionWorld
.
fZ
,
&
my
.
fX
,
&
my
.
fY
)
;
SF
->
getGame
(
)
->
convert3DCoordsToScreen
(
pedPositionWorld
.
fX
,
pedPositionWorld
.
fY
,
pedPositionWorld
.
fZ
,
&
my
.
fX
,
&
my
.
fY
)
;
if
(
pedPositionScreen
.
fZ
>
1.f
)
{
// что делать тут?
ImGui
::
GetBackgroundDrawList
(
)
->
AddLine
(
{
my
.
fX
,
my
.
fY
}
,
{
ped
.
fX
,
ped
.
fY
}
,
-
1
)
;
}
}
}
|
|
|