ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   Общие вопросы программирования (https://forum.antichat.xyz/forumdisplay.php?f=206)
-   -   SAMP API ходьба по координатам (https://forum.antichat.xyz/showthread.php?t=1502815)

PED 08.02.2024 18:10

SAMP API как реализовать ходьбу по координатам

Adofe 08.02.2024 19:18

Информация - Полезные функции

uint8_t getPlayerWeaponModelID(int iPlayerID) { if (g_Players == NULL || iPlayerID SAMP_MAX_PLAYERS) return NULL; if (iPlayerID == g_Players->sLocalPlayerID) { if (g_Players->pLocalPlayer->pSAMP_Actor == NULL) return NULL...

www.blast.hk


и добавь зажатие W

PED 08.02.2024 22:23

Не работает:





[CODE]
float
x
=
2197.28
;
float
y
=
-
2188.46
;
DWORD
*
pActorMtrx
=
(
DWORD
*
)
(
(
*
ptrActor
)
+
0x14
)
;
CVector2D
pPos
(
*
(
float
*
)
(
(
*
pActorMtrx
)
+
0x30
)
,
*
(
float
*
)
(
(
*
pActorMtrx
)
+
0x34
)
)
;
CVector2D
cPos
(
*
(
float
*
)
(
0xB6F9CC
)
,
*
(
float
*
)
(
0xB6F9D0
)
)
;
float
ac
=
sqrt
(
pow
(
fabs
(
cPos
.
x
-
x
)
,
2
)
+
pow
(
fabs
(
cPos
.
y
-
y
)
,
2
)
)
;
float
alpha
=
asin
(
fabs
(
cPos
.
x
-
x
)
/
ac
)
;
float
beta
=
acos
(
fabs
(
cPos
.
x
-
x
)
/
ac
)
;
if
(
(
pPos
.
x
>
x
)
&&
(
pPos
.
y

x
)
&&
(
pPos
.
y
>
y
)
)
*
xCam
=
beta
;
if
(
(
pPos
.
x

y
)
)
*
xCam
=
(
alpha
+
(
1.57
)
)
;
if
(
(
pPos
.
x

GetPosition
(
)
;
float
dist
=
(
vect
.
y
,
vect
.
x
)
;
do
{
if
(
active
)
{
if
(
!
sprint
)
SAMP
::
isKeyPressed
(
87
)
;
else
{
SAMP
::
isKeyPressed
(
87
)
;
}
}
}
while
(
active
||
dist



Не работает

ARMOR 08.02.2024 22:24

[QUOTE="PED"]

Не работает:





[CODE]
float
x
=
2197.28
;
float
y
=
-
2188.46
;
DWORD
*
pActorMtrx
=
(
DWORD
*
)
(
(
*
ptrActor
)
+
0x14
)
;
CVector2D
pPos
(
*
(
float
*
)
(
(
*
pActorMtrx
)
+
0x30
)
,
*
(
float
*
)
(
(
*
pActorMtrx
)
+
0x34
)
)
;
CVector2D
cPos
(
*
(
float
*
)
(
0xB6F9CC
)
,
*
(
float
*
)
(
0xB6F9D0
)
)
;
float
ac
=
sqrt
(
pow
(
fabs
(
cPos
.
x
-
x
)
,
2
)
+
pow
(
fabs
(
cPos
.
y
-
y
)
,
2
)
)
;
float
alpha
=
asin
(
fabs
(
cPos
.
x
-
x
)
/
ac
)
;
float
beta
=
acos
(
fabs
(
cPos
.
x
-
x
)
/
ac
)
;
if
(
(
pPos
.
x
>
x
)
&&
(
pPos
.
y

x
)
&&
(
pPos
.
y
>
y
)
)
*
xCam
=
beta
;
if
(
(
pPos
.
x

y
)
)
*
xCam
=
(
alpha
+
(
1.57
)
)
;
if
(
(
pPos
.
x

GetPosition
(
)
;
float
dist
=
(
vect
.
y
,
vect
.
x
)
;
do
{
if
(
active
)
{
if
(
!
sprint
)
SAMP
::
isKeyPressed
(
87
)
;
else
{
SAMP
::
isKeyPressed
(
87
)
;
}
}
}
while
(
active
||
dist

PED 08.02.2024 22:31

Цитата:

Сообщение от ARMOR

Ты добавил проверку нажата ли клавиша, а не её нажатие.

как вызвать функцию вызова кнопки в самп апи

Adofe 09.02.2024 15:43

Можешь юзать функции: SendInput, keybd_event и т.д...


Время: 15:48