Показать сообщение отдельно

  #6  
Старый 14.08.2024, 01:31
AdCKuY_DpO4uLa
Постоянный
Регистрация: 05.08.2018
Сообщений: 372
С нами: 4091290

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

[QUOTE="!Sam#0235"]

Is there a way to get the string from a textdraw in a loop using RakHook?
Есть ли способ получить строку из зацикленного текстового рисунка с помощью RakHook?

This only works the first time the textdraw is displayed, using while will cause the game to freeze.
Это работает только при первом отображении textdraw, использование while приведет к зависанию игры.

C++:





[CODE]
bool
PluginRPC
::
onShowTextDraw
(
unsigned
char
&
id
,
RakNet
::
BitStream
*
bs
)
{
if
(
id
!=
134
)
{
return
true
;
}
uint16_t
wTextDrawID
;
uint8_t
Flags
;
float
fLetterWidth
;
float
fLetterHeight
;
uint32_t
dLetterColor
;
float
fLineWidth
;
float
fLineHeight
;
uint32_t
dBoxColor
;
uint8_t
Shadow
;
uint8_t
Outline
;
uint32_t
dBackgroundColor
;
uint8_t
Style
;
uint8_t
Selectable
;
float
fX
;
float
fY
;
uint16_t
wModelID
;
float
fRotX
;
float
fRotY
;
float
fRotZ
;
float
fZoom
;
int16_t
wColor1
;
int16_t
wColor2
;
uint16_t
szTextLen
;
std
::
string szText
;
bs
->
Read
(
wTextDrawID
)
;
bs
->
Read
(
Flags
)
;
bs
->
Read
(
fLetterWidth
)
;
bs
->
Read
(
fLetterHeight
)
;
bs
->
Read
(
dLetterColor
)
;
bs
->
Read
(
fLineWidth
)
;
bs
->
Read
(
fLineHeight
)
;
bs
->
Read
(
dBoxColor
)
;
bs
->
Read
(
Shadow
)
;
bs
->
Read
(
Outline
)
;
bs
->
Read
(
dBackgroundColor
)
;
bs
->
Read
(
Style
)
;
bs
->
Read
(
Selectable
)
;
bs
->
Read
(
fX
)
;
bs
->
Read
(
fY
)
;
bs
->
Read
(
wModelID
)
;
bs
->
Read
(
fRotX
)
;
bs
->
Read
(
fRotY
)
;
bs
->
Read
(
fRotZ
)
;
bs
->
Read
(
fZoom
)
;
bs
->
Read
(
wColor1
)
;
bs
->
Read
(
wColor2
)
;
bs
->
Read
(
szTextLen
)
;
szText
.
resize
(
szTextLen
)
;
bs
->
Read
(
szText
.
data
(
)
,
szTextLen
)
;
if
(
wTextDrawID
==
2053
)
{
std
::
string gasolina
=
szText
;
std
::
string gasolinaValue
=
gasolina
;
size_t startPos
=
gasolina
.
find
(
"{"
)
;
size_t endPos
=
gasolina
.
find
(
"}"
)
;
if
(
startPos
!=
std
::
string
::
npos
&&
endPos
!=
std
::
string
::
npos
)
{
gasolinaValue
=
gasolina
.
substr
(
startPos
+
1
,
endPos
-
startPos
-
1
)
;
}
std
::
cout
 
Ответить с цитированием