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

  #7621  
Старый 16.09.2025, 21:49
writeline
Новичок
Регистрация: 16.01.2022
Сообщений: 28
С нами: 2276608

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

Пробую изменить размеры радара, при открытии сцены игры крашит, в чём может быть проблема? 🧐

с++:





Код:
const
float
RadarWidth
=
1.8f
;
// NewWidth
const
float
RadarHeight
=
1.8f
;
// NewHeight
template

bool
SafeWrite
(
void
*
address
,
T value
)
{
DWORD oldProtect
;
if
(
VirtualProtect
(
address
,
sizeof
(
T
)
,
PAGE_EXECUTE_READWRITE
,
&
oldProtect
)
)
{
*
reinterpret_cast

(
address
)
=
value
;
VirtualProtect
(
address
,
sizeof
(
T
)
,
oldProtect
,
&
oldProtect
)
;
return
true
;
}
return
false
;
}
void
SetRadarSize
(
)
{
//height
uintptr_t widthAddresses
[
]
=
{
0x5834C2
,
0x58A449
,
0x58A7E9
,
0x58A840
,
0x58A943
,
0x58A99D
}
;
for
(
auto
addr
:
widthAddresses
)
SafeWrite

(
reinterpret_cast

(
addr
)
,
RadarWidth
)
;
//width
uintptr_t heightAddresses
[
]
=
{
0x58A47D
,
0x58A632
,
0x58A6AB
,
0x58A70E
,
0x58A801
,
0x58A8AB
,
0x58A921
,
0x58A9D5
,
0x5834F6
}
;
for
(
auto
addr
:
heightAddresses
)
SafeWrite

(
reinterpret_cast

(
addr
)
,
RadarHeight
)
;
}




Крашит как только должен появится радар
 
Ответить с цитированием

  #7622  
Старый 17.09.2025, 20:34
Winstаl
Познавший АНТИЧАТ
Регистрация: 31.01.2019
Сообщений: 1,011
С нами: 3833192

Репутация: 138


По умолчанию

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

Пробую изменить размеры радара, при открытии сцены игры крашит, в чём может быть проблема? 🧐

с++:





Код:
const
float
RadarWidth
=
1.8f
;
// NewWidth
const
float
RadarHeight
=
1.8f
;
// NewHeight
template

bool
SafeWrite
(
void
*
address
,
T value
)
{
DWORD oldProtect
;
if
(
VirtualProtect
(
address
,
sizeof
(
T
)
,
PAGE_EXECUTE_READWRITE
,
&
oldProtect
)
)
{
*
reinterpret_cast

(
address
)
=
value
;
VirtualProtect
(
address
,
sizeof
(
T
)
,
oldProtect
,
&
oldProtect
)
;
return
true
;
}
return
false
;
}
void
SetRadarSize
(
)
{
//height
uintptr_t widthAddresses
[
]
=
{
0x5834C2
,
0x58A449
,
0x58A7E9
,
0x58A840
,
0x58A943
,
0x58A99D
}
;
for
(
auto
addr
:
widthAddresses
)
SafeWrite

(
reinterpret_cast

(
addr
)
,
RadarWidth
)
;
//width
uintptr_t heightAddresses
[
]
=
{
0x58A47D
,
0x58A632
,
0x58A6AB
,
0x58A70E
,
0x58A801
,
0x58A8AB
,
0x58A921
,
0x58A9D5
,
0x5834F6
}
;
for
(
auto
addr
:
heightAddresses
)
SafeWrite

(
reinterpret_cast

(
addr
)
,
RadarHeight
)
;
}



Крашит как только должен появится радар
Ты указатель на переменные должен передавать, а не их значение, вроде как.
 
Ответить с цитированием

  #7623  
Старый 19.09.2025, 20:46
zytrix
Новичок
Регистрация: 01.03.2025
Сообщений: 3
С нами: 635709

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

как именно в сампе работает сериализация пакетов?(acks если быть точным)
 
Ответить с цитированием

  #7624  
Старый 19.09.2025, 23:50
0xff65
Познающий
Регистрация: 23.01.2022
Сообщений: 36
С нами: 2267665

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

Приветствую, каким образом можно реализовать что бы цикл повторялся не бесконечно, а не более 2 раз? - при нажатии на кнопку 50

C++:





Код:
#include "plugin.h"
#include "CWorld.h"
#include "CCamera.h"
#include "extensions/ScriptCommands.h"
using
namespace
plugin
;
class
Project5
{
public
:
std
::
unordered_map
>
vKeys
=
{
{
49
,
{
31
,
30
}
}
,
{
50
,
{
22
,
23
,
24
}
}
,
{
51
,
{
25
,
27
,
26
}
}
,
{
52
,
{
29
}
}
,
{
53
,
{
34
,
33
}
}
}
;
Project5
(
)
{
Events
::
drawingEvent
+=
[
this
]
{
if
(
!
isPlayerPlaying
(
)
||
isInputActive
(
)
)
return
;
for
(
const
auto
&
[
key
,
weapons
]
:
vKeys
)
{
if
(
KeyPressed
(
key
)
)
{
printf
(
"Key: %d\n"
,
key
)
;
CPed
*
pPed
=
CWorld
::
Players
[
CWorld
::
PlayerInFocus
]
.
m_pPed
;
std
::
uint32_t
nHandle
=
CPools
::
GetPedRef
(
pPed
)
;
for
(
std
::
uint8_t
nWeapon
:
weapons
)
{
printf
(
"Weapon: %d\n"
,
nWeapon
)
;
if
(
Command

(
nHandle
,
nWeapon
)
)
{
Command

(
nHandle
,
0
)
;
Command

(
nHandle
,
nWeapon
)
;
break
;
}
}
}
}
}
;
}
bool
isPlayerPlaying
(
)
{
return
CWorld
::
Players
[
CWorld
::
PlayerInFocus
]
.
m_pPed
!=
nullptr
;
}
bool
isInputActive
(
)
{
CPed
*
pPed
=
CWorld
::
Players
[
CWorld
::
PlayerInFocus
]
.
m_pPed
;
return
(
pPed
&&
pPed
->
m_pVehicle
)
;
}
}
Project5Plugin
;
 
Ответить с цитированием

  #7625  
Старый 20.09.2025, 03:21
Wowisky
Новичок
Регистрация: 03.03.2025
Сообщений: 3
С нами: 632211

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

Цитата:
Сообщение от 0xff65  

Hello, how can I make the cycle repeat no more than 2 times, rather than infinitely? - when I press button 50
int count = 0;

if (count > 2) return;

if(key == 50)

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

  #7626  
Старый 20.09.2025, 21:44
0x9
Познающий
Регистрация: 24.08.2021
Сообщений: 31
С нами: 2485494

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

появилась необходимось хука объектов но стандартный хук плагин сдк не работает

Код:





[CODE]
plugin::Events:bjectRenderEvent.before += [](CEntity* o) {
cout



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

  #7627  
Старый 24.09.2025, 20:38
MSIshka
Познающий
Регистрация: 23.02.2024
Сообщений: 76
С нами: 1170582

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

Почему не срабатывает хук чата?

C++:





Код:
using
ChatFunc_t
=
void
(
__thiscall
*
)
(
void
*
thisptr
,
uint32_t
type
,
const
char
*
text
,
const
char
*
prefix
,
uint32_t
color
,
uint32_t
pcolor
)
;
ChatFunc_t g_origChatFunc
=
nullptr
;
void
__fastcall
ChatDetour
(
void
*
thisptr
,
void
*
edx
,
uint32_t
type
,
const
char
*
text
,
const
char
*
prefix
,
uint32_t
color
,
uint32_t
pcolor
)
{
std
::
string texta
=
text
?
text
:
""
;
std
::
string prefixa
=
prefix
?
prefix
:
""
;
bool
shouldHide
=
ProcessSpecialMessage
(
texta
)
;
if
(
!
shouldHide
)
{
std
::
string colorHex
=
ARGBtoRGB
(
color
)
;
if
(
type
==
2
)
{
std
::
string prefixColorHex
=
ARGBtoRGB
(
pcolor
)
;
texta
=
"{"
+
prefixColorHex
+
"}"
+
prefixa
+
" {"
+
colorHex
+
"}"
+
texta
;
}
std
::
string finalMessage
=
"{"
+
colorHex
+
"}"
+
GetCurrentTimeString
(
)
+
" "
+
texta
;
ExecuteJSOnCEF
(
finalMessage
)
;
}
if
(
g_origChatFunc
)
g_origChatFunc
(
thisptr
,
type
,
text
,
prefix
,
color
,
pcolor
)
;
}
bool
InstallChatHook
(
)
{
HMODULE samp
=
GetModuleHandleA
(
"samp.dll"
)
;
uintptr_t addr
=
reinterpret_cast

(
samp
)
+
0x64010
;
if
(
MH_CreateHook
(
reinterpret_cast

(
addr
)
,
&
ChatDetour
,
reinterpret_cast

(
&
g_origChatFunc
)
)
!=
MH_OK
)
return
false
;
if
(
MH_EnableHook
(
reinterpret_cast

(
addr
)
)
!=
MH_OK
)
return
false
;
return
true
;
}
void
__fastcall
ActivateChatBlocker
(
void
*
thisptr
)
{
return
;
}
bool
InstallActivateChatHook
(
)
{
HMODULE samp
=
GetModuleHandleA
(
"samp.dll"
)
;
if
(
!
samp
)
return
false
;
uintptr_t addr
=
reinterpret_cast

(
samp
)
+
0x657E0
;
if
(
MH_CreateHook
(
reinterpret_cast

(
addr
)
,
reinterpret_cast

(
&
ActivateChatBlocker
)
,
nullptr
)
!=
MH_OK
)
return
false
;
return
MH_EnableHook
(
reinterpret_cast

(
addr
)
)
==
MH_OK
;
}
DWORD WINAPI
PluginThread
(
LPVOID
)
{
while
(
!
GetModuleHandleA
(
"samp.dll"
)
)
{
Sleep
(
100
)
;
}
LoadSettings
(
)
;
if
(
MH_Initialize
(
)
!=
MH_OK
)
{
OutputDebugStringA
(
"MinHook init failed\n"
)
;
return
1
;
}
if
(
!
InstallChatHook
(
)
)
{
OutputDebugStringA
(
"Chat hook failed\n"
)
;
}
if
(
!
InstallActivateChatHook
(
)
)
{
OutputDebugStringA
(
"Activate chat hook failed\n"
)
;
}
MH_Uninitialize
(
)
;
return
0
;
}
BOOL APIENTRY
DllMain
(
HMODULE hModule
,
DWORD ul_reason_for_call
,
LPVOID lpReserved
)
{
switch
(
ul_reason_for_call
)
{
case
DLL_PROCESS_ATTACH
:
DisableThreadLibraryCalls
(
hModule
)
;
CreateThread
(
nullptr
,
0
,
PluginThread
,
nullptr
,
0
,
nullptr
)
;
break
;
case
DLL_PROCESS_DETACH
:
g_running
=
false
;
break
;
}
return
TRUE
;
}
 
Ответить с цитированием

  #7628  
Старый 24.09.2025, 22:16
0xff65
Познающий
Регистрация: 23.01.2022
Сообщений: 36
С нами: 2267665

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

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

int count = 0;

if (count > 2) return;
if(key == 50)
count++;
Не работает совсем

C++:





Код:
#include "plugin.h"
#include "CWorld.h"
#include "CCamera.h"
#include "extensions/ScriptCommands.h"
using
namespace
plugin
;
class
Project5
{
public
:
std
::
unordered_map
>
vKeys
=
{
{
49
,
{
31
,
30
}
}
,
{
50
,
{
22
,
23
,
24
}
}
,
{
51
,
{
25
,
27
,
26
}
}
,
{
52
,
{
29
}
}
,
{
53
,
{
34
,
33
}
}
}
;
int
count
=
0
;
Project5
(
)
{
Events
::
drawingEvent
+=
[
this
]
{
if
(
!
isPlayerPlaying
(
)
||
isInputActive
(
)
)
return
;
for
(
const
auto
&
[
key
,
weapons
]
:
vKeys
)
{
if
(
key
==
50
)
{
if
(
count
>
2
)
continue
;
if
(
KeyPressed
(
key
)
)
{
count
++
;
printf
(
"Key: %d\n"
,
key
)
;
CPed
*
pPed
=
CWorld
::
Players
[
CWorld
::
PlayerInFocus
]
.
m_pPed
;
std
::
uint32_t
nHandle
=
CPools
::
GetPedRef
(
pPed
)
;
for
(
std
::
uint8_t
nWeapon
:
weapons
)
{
printf
(
"Weapon: %d\n"
,
nWeapon
)
;
if
(
Command

(
nHandle
,
nWeapon
)
)
{
Command

(
nHandle
,
0
)
;
Command

(
nHandle
,
nWeapon
)
;
break
;
}
}
}
}
else
{
if
(
KeyPressed
(
key
)
)
{
printf
(
"Key: %d\n"
,
key
)
;
CPed
*
pPed
=
CWorld
::
Players
[
CWorld
::
PlayerInFocus
]
.
m_pPed
;
std
::
uint32_t
nHandle
=
CPools
::
GetPedRef
(
pPed
)
;
for
(
std
::
uint8_t
nWeapon
:
weapons
)
{
printf
(
"Weapon: %d\n"
,
nWeapon
)
;
if
(
Command

(
nHandle
,
nWeapon
)
)
{
Command

(
nHandle
,
0
)
;
Command

(
nHandle
,
nWeapon
)
;
break
;
}
}
}
}
}
}
;
}
bool
isPlayerPlaying
(
)
{
return
CWorld
::
Players
[
CWorld
::
PlayerInFocus
]
.
m_pPed
!=
nullptr
;
}
bool
isInputActive
(
)
{
CPed
*
pPed
=
CWorld
::
Players
[
CWorld
::
PlayerInFocus
]
.
m_pPed
;
return
(
pPed
&&
pPed
->
m_pVehicle
)
;
}
}
Project5Plugin
;
 
Ответить с цитированием

  #7629  
Старый 25.09.2025, 18:05
MSIshka
Познающий
Регистрация: 23.02.2024
Сообщений: 76
С нами: 1170582

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

Почему вместо text отправляется @text" ? Хотя через samp::RefChat()->AddMessage(0xFFFFFFFF, text.data()); отправляется всё нормально.

C++:





[CODE]
void
__stdcall
js_sendMessage
(
WebFrame frame
,
const
char
*
name
,
const
char
*
*
argv
,
int
argc
)
{
if
(
!
argv
||
argc





Как с помощью samp api использовать sampProcessChatInput?
 
Ответить с цитированием

  #7630  
Старый 26.09.2025, 11:34
kishemishe
Новичок
Регистрация: 26.09.2025
Сообщений: 1
С нами: 334495

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

Как сделать табы (вкладки) в ImGui? Я делаю свой чит на кс2 на c++, считай только учусь, пока что делаю гуи и остановился на том когда нужно было сделать табы, мне нужно чтобы можно было менять и их размер, и их расположение, и шрифт текста в нем
 
Ответить с цитированием
Ответ





Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


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




ANTICHAT ™ © 2001- Antichat Kft.