HOME FORUMS MEMBERS RECENT POSTS LOG IN  
× Авторизация
Имя пользователя:
Пароль:
Нет аккаунта? Регистрация
Баннер 1   Баннер 2
НОВЫЕ ТОРГОВАЯ НОВОСТИ ЧАТ
loading...
Скрыть
Вернуться   ANTICHAT > ПРОГРАММИРОВАНИЕ > С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby
   
Ответ
 
Опции темы Поиск в этой теме Опции просмотра

  #6801  
Старый 17.03.2023, 12:03
LorianS1
Новичок
Регистрация: 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;.
 
Ответить с цитированием

  #6802  
Старый 17.03.2023, 12:51
Dzho_Handerson
Новичок
Регистрация: 10.07.2019
Сообщений: 6
С нами: 3602609

Репутация: 51
По умолчанию

Цитата:
Сообщение от Dzho_Handerson  

Приветствую, подскажите как удалить лишние пункты из меню esc через asi?
up
 
Ответить с цитированием

  #6803  
Старый 17.03.2023, 13:10
LorianS1
Новичок
Регистрация: 17.03.2023
Сообщений: 8
С нами: 1665045

Репутация: 3
По умолчанию

Цитата:
Сообщение от Dzho_Handerson  

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

  #6804  
Старый 18.03.2023, 14:12
ччбчлчлчъ ччччшчьпьппзвжв
Постоянный
Регистрация: 16.08.2020
Сообщений: 553
С нами: 3022568

Репутация: 68


По умолчанию



что я не так делаю, почему это не компилируется?

https://graphviz.org/pdf/libguide.pdf



 
Ответить с цитированием

  #6805  
Старый 18.03.2023, 22:27
LorianS1
Новичок
Регистрация: 17.03.2023
Сообщений: 8
С нами: 1665045

Репутация: 3
По умолчанию

Цитата:
Сообщение от rinkу  

что я не так делаю, почему это не компилируется?

https://graphviz.org/pdf/libguide.pdf
Возможно то, что файл повреждён

Возможно, что он был перемещён, убедись, что он действительно там, обнови путь


Попробуй установить путь к библиотеке Graphviz явно при компиляции с помощью опции -L

" gcc myprogram.c -o myprogram -L/path/to/graphviz/lib -lgvc "

Замени /path/to/graphviz/lib на путь к каталогу с библиотекой Graphviz
 
Ответить с цитированием

  #6806  
Старый 20.03.2023, 05:38
0x73616D
Участник форума
Регистрация: 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
;
}
}
}
 
Ответить с цитированием

  #6807  
Старый 23.03.2023, 01:06
ччбчлчлчъ ччччшчьпьппзвжв
Постоянный
Регистрация: 16.08.2020
Сообщений: 553
С нами: 3022568

Репутация: 68


По умолчанию



что делаю не так, почему я не могу открыть проект после билда
 
Ответить с цитированием

  #6808  
Старый 23.03.2023, 01:09
reussssya
Новичок
Регистрация: 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)
 
Ответить с цитированием

  #6809  
Старый 23.03.2023, 22:25
0x73616D
Участник форума
Регистрация: 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
 
Ответить с цитированием

  #6810  
Старый 24.03.2023, 20:25
YaAkeGGa228
Познающий
Регистрация: 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)
 


Быстрый переход




ANTICHAT ™ © 2001- Antichat Kft.