 |
|

17.03.2023, 12:03
|
|
Новичок
Регистрация: 17.03.2023
Сообщений: 8
С нами:
1665045
Репутация:
3
|
|
Сообщение от !Sam#0235
Can someone help me rewrite these .lua snippets in C++? I tried it on my own but it didn't work
Lua:
Код:
if
move
==
true
then
cursor
(
)
repeat
wait
(
0
)
cursorx
,
cursory
=
getCursorPos
(
)
sampToggleCursor
(
1
)
Ini
.
cfg
.
x
=
cursorx
Ini
.
cfg
.
y
=
cursory
if
isKeyDown
(
27
)
then
move
=
0
end
until
isKeyDown
(
32
)
sampToggleCursor
(
0
)
sampSetCursorMode
(
0
)
move
=
false
Ini
.
cfg
.
x
=
cursorx
Ini
.
cfg
.
y
=
cursory
inicfg
.
save
(
Ini
,
MyIni
)
end
Lua:
Код:
function
cursor
(
)
local
x
,
y
=
getScreenResolution
(
)
local
x
=
x
/
2
local
y
=
x
/
2
-- local x = x - 100
local
y
=
y
-
-
70
local
result
,
lib
=
loadDynamicLibrary
(
"user32.dll"
)
if
result
then
local
result
,
proc
=
getDynamicLibraryProcedure
(
"SetCursorPos"
,
lib
)
local
a
=
callFunction
(
proc
,
2
,
0
,
x
,
y
)
freeDynamicLibrary
(
lib
)
end
end
sure.
1.
C++:
Код:
#include "inicfg.h"
ImVec4
color
(
mainIni
.
color
.
R
/
255.0f
,
mainIni
.
color
.
G
/
255.0f
,
mainIni
.
color
.
B
/
255.0f
,
1.0f
)
;
if
(
ImGui
::
ColorEdit4
(
"Color"
,
&
color
.
x
)
)
{
int
clr
=
join_argb
(
0
,
color
.
x
*
255
,
color
.
y
*
255
,
color
.
z
*
255
,
color
.
w
*
255
)
;
int
r
=
color
.
x
*
255
,
g
=
color
.
y
*
255
,
b
=
color
.
z
*
255
,
a
=
color
.
w
*
255
;
mainIni
.
config
.
hex
=
(
"%06X"
)
.
format
(
clr
)
;
mainIni
.
color
.
R
=
r
;
mainIni
.
color
.
G
=
g
;
mainIni
.
color
.
B
=
b
;
inicfg
::
save
(
mainIni
,
directIni
)
;
}
2.
C++:
Код:
#include
void
cursor
(
)
{
int
x
=
GetSystemMetrics
(
SM_CXSCREEN
)
/
2
;
int
y
=
GetSystemMetrics
(
SM_CYSCREEN
)
/
2
;
// x = x - 100; // uncomment this line if you want to move the cursor to the left by 100px
y
=
y
+
70
;
// moves the cursor 70 pixels down
SetCursorPos
(
x
,
y
)
;
// set the cursor to a new position
}
p.s
In this code, we use the GetSystemMetrics WinAPI function to get the screen resolution, and then use the SetCursorPos function to move the cursor to the specified location. By default, the cursor will be shifted 70 pixels down. If you want to move the cursor to the left by 100 pixels, then uncomment the line x = x - 100;.
|
|
|

17.03.2023, 12:51
|
|
Новичок
Регистрация: 10.07.2019
Сообщений: 6
С нами:
3602609
Репутация:
51
|
|
Сообщение от Dzho_Handerson
Приветствую, подскажите как удалить лишние пункты из меню esc через asi?
up
|
|
|

17.03.2023, 13:10
|
|
Новичок
Регистрация: 17.03.2023
Сообщений: 8
С нами:
1665045
Репутация:
3
|
|
Сообщение от Dzho_Handerson
up
Привет.
- Скачай и установи библиотеку Cleo 4
- Создай новую папку внутри папки "CLEO" и назови ее "CLEO_TEXT"
- В папке "CLEO_TEXT" создай новый файл с именем "MENU" и расширением ".fxt"
- Открой созданный файл с помощью любого текстового редактора и добавь в него строки в формате: $REMOVE_TEXT_FROM_ESC "Название пункта меню, который нужно удалить" (Пример: $REMOVE_TEXT_FROM_ESC "Audio Settings")
Ну и в принципе всё, сохрани файл и зайди в игру, должны пропасть
|
|
|

18.03.2023, 14:12
|
|
Постоянный
Регистрация: 16.08.2020
Сообщений: 553
С нами:
3022568
Репутация:
68
|
|
|
|
|

18.03.2023, 22:27
|
|
Новичок
Регистрация: 17.03.2023
Сообщений: 8
С нами:
1665045
Репутация:
3
|
|
Возможно то, что файл повреждён
Возможно, что он был перемещён, убедись, что он действительно там, обнови путь
Попробуй установить путь к библиотеке Graphviz явно при компиляции с помощью опции -L
" gcc myprogram.c -o myprogram -L/path/to/graphviz/lib -lgvc "
Замени /path/to/graphviz/lib на путь к каталогу с библиотекой Graphviz
|
|
|

20.03.2023, 05:38
|
|
Участник форума
Регистрация: 27.05.2021
Сообщений: 140
С нами:
2614229
Репутация:
33
|
|
What's wrong? my game freezes when using this function, in theory the function should get the X & Y position of the cursor until I press the space key, but when calling the function the game just freezes
C++:
Код:
void
cursor_move
(
)
{
bool
mueve
=
true
;
while
(
mueve
==
true
)
{
activew
=
false
;
//cursor();
SF
->
getSAMP
(
)
->
getMisc
(
)
->
ToggleCursor
(
2
,
true
)
;
POINT cursor
=
SF
->
getGame
(
)
->
getCursorPos
(
)
;
int
cursorx
,
cursory
;
cursorx
=
cursor
.
x
;
cursory
=
cursor
.
y
;
if
(
SF
->
getGame
(
)
->
isKeyDown
(
VK_SPACE
)
)
{
mueve
=
false
;
SF
->
getSAMP
(
)
->
getMisc
(
)
->
ToggleCursor
(
false
)
;
activew
=
true
;
break
;
}
}
}
|
|
|

23.03.2023, 01:06
|
|
Постоянный
Регистрация: 16.08.2020
Сообщений: 553
С нами:
3022568
Репутация:
68
|
|
что делаю не так, почему я не могу открыть проект после билда
|
|
|

23.03.2023, 01:09
|
|
Новичок
Регистрация: 12.03.2023
Сообщений: 28
С нами:
1671509
Репутация:
3
|
|
Сообщение от !Sam#0235
What's wrong? my game freezes when using this function, in theory the function should get the X & Y position of the cursor until I press the space key, but when calling the function the game just freezes
C++:
Код:
void
cursor_move
(
)
{
bool
mueve
=
true
;
while
(
mueve
==
true
)
{
activew
=
false
;
//cursor();
SF
->
getSAMP
(
)
->
getMisc
(
)
->
ToggleCursor
(
2
,
true
)
;
POINT cursor
=
SF
->
getGame
(
)
->
getCursorPos
(
)
;
int
cursorx
,
cursory
;
cursorx
=
cursor
.
x
;
cursory
=
cursor
.
y
;
if
(
SF
->
getGame
(
)
->
isKeyDown
(
VK_SPACE
)
)
{
mueve
=
false
;
SF
->
getSAMP
(
)
->
getMisc
(
)
->
ToggleCursor
(
false
)
;
activew
=
true
;
break
;
}
}
}
ur problem is while(true)
|
|
|

23.03.2023, 22:25
|
|
Участник форума
Регистрация: 27.05.2021
Сообщений: 140
С нами:
2614229
Репутация:
33
|
|
Сообщение от reussssya
ur problem is while(true)
well, how can i fix it? what do you suggest for my code to work correctly? I don't know what to do honestly
|
|
|

24.03.2023, 20:25
|
|
Познающий
Регистрация: 12.08.2022
Сообщений: 59
С нами:
1976847
Репутация:
18
|
|
Нужна помощь, я получаю координаты метки на карте, но Z у нас будет равен 0, из за этого получается все по пизде. На луа нашел решение данной проблемы:
lua:
Код:
local
result
,
xTarget
,
yTarget
,
zTarget
=
getTargetBlipCoordinates
(
)
requestCollision
(
xTarget
,
yTarget
)
loadScene
(
xTarget
,
yTarget
,
zTarget
)
arg1
,
arg2
,
arg3
=
xTarget
,
yTarget
,
getGroundZFor3dCoord
(
xTarget
,
yTarget
,
999
)
-- то есть в arg3 записан нормальный, адекватный Z, он равен земле, на которую в дальнейшем мы тпаемся
а на плюсах найти Z - проблемка, хелпуйте
|
|
|
|
 |
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|