
17.03.2021, 18:11
|
|
Познавший АНТИЧАТ
Регистрация: 18.09.2017
Сообщений: 1,044
С нами:
4553429
Репутация:
153
|
|
Сообщение от FritRose
что конкретно не получилось?
Гта виснет и все, по разному я пробовал.
Оригинал на Lua:
Lua:
Код:
function
BeginToPoint
(
x
,
y
,
z
,
radius
,
move_code
,
isSprint
,
isJumping
)
repeat
local
posX
,
posY
,
posZ
=
getCharCoordinates
(
PLAYER_PED
)
setCameraToCoord
(
x
,
y
)
;
MovePlayer
(
move_code
,
isSprint
,
isJumping
)
;
local
dist
=
getDistanceBetweenCoords3d
(
x
,
y
,
z
,
posX
,
posY
,
z
)
;
wait
(
0
)
until
not
bot
.
active
.
v
or
dist
=
9909999
then
isSprint
=
false
setGameKeyState
(
14
,
255
)
;
wait
(
200
)
isSprint
=
true
end
end
end
)
if
isSprint
then
setGameKeyState
(
16
,
255
)
end
end
Переписал на с++ без прыжка:
C++:
[CODE]
void
cameraset
(
float
X
,
float
Y
)
{
CVector mypos
;
CVector enpos
;
CVector vector
;
enpos
.
fX
=
X
;
enpos
.
fY
=
Y
;
CCamera
*
pCamera
=
GAME
->
GetCamera
(
)
;
mypos
=
*
pCamera
->
GetCam
(
pCamera
->
GetActiveCam
(
)
)
->
GetSource
(
)
;
vector
=
mypos
-
enpos
;
float
AngleX
=
atan2f
(
vector
.
fY
,
-
vector
.
fX
)
-
M_PI
/
2
;
*
(
float
*
)
0xB6F258
=
-
(
AngleX
-
M_PI
/
2
)
;
}
void
BeginToPoint
(
float
X
,
float
Y
,
float
radius
,
bool
sprint
,
bool
active
)
{
CVector
*
vect
=
PEDSELF
->
GetPosition
(
)
;
float
dist
=
sqrt
(
(
X
-
vect
->
fX
)
*
(
X
-
vect
->
fX
)
+
(
Y
-
vect
->
fY
)
*
(
Y
-
vect
->
fY
)
)
;
do
{
if
(
active
)
{
cameraset
(
X
,
Y
)
;
if
(
!
sprint
)
SF
->
getGame
(
)
->
emulateGTAKey
(
16
,
255
)
;
// Обычный бег
else
{
SF
->
getGame
(
)
->
emulateGTAKey
(
16
,
255
)
;
// Обычный бег
SF
->
getGame
(
)
->
emulateGTAKey
(
1
,
-
128
)
;
// Спринт
}
}
}
while
(
active
||
dist
|
|
|