 |

05.04.2021, 22:26
|
|
Новичок
Регистрация: 05.04.2021
Сообщений: 2
С нами:
2688352
Репутация:
1
|
|
Hey guys, I'd like to asking for help that something about this code. VS doesn't show any error or something but plugin makes game crash when I logged in to spawn. The problem could be getting packet
C++:
Код:
bool
CALLBACK
IncomingRPC
(
stRakNetHookParams
*
params
)
{
if
(
params
->
packetId
==
ScriptRPCEnumeration
::
RPC_ScrSetPlayerMapIcon
)
{
BYTE iconid
;
BYTE type
;
int
color
;
params
->
bitStream
->
ResetReadPointer
(
)
;
params
->
bitStream
->
Read
(
iconid
)
;
params
->
bitStream
->
Read
(
pos
[
0
]
)
;
params
->
bitStream
->
Read
(
pos
[
1
]
)
;
params
->
bitStream
->
Read
(
pos
[
2
]
)
;
params
->
bitStream
->
Read
(
type
)
;
params
->
bitStream
->
Read
(
color
)
;
if
(
type
==
0
)
{
if
(
color
==
0xA50000ff
)
{
int
car
=
SF
->
getSAMP
(
)
->
getVehicles
(
)
->
GetCarHandleFromSAMPCarID
(
SF
->
getSAMP
(
)
->
getPlayers
(
)
->
pLocalPlayer
->
sCurrentVehicleID
)
;
char
_text
[
100
]
;
if
(
_cp
==
false
)
{
sprintf
(
_text
,
"02D3: %d %f %f %f"
,
car
,
pos
[
0
]
,
pos
[
1
]
,
pos
[
2
]
)
;
SF
->
getCLEO
(
)
->
callOpcode
(
_text
)
;
SF
->
getSAMP
(
)
->
getChat
(
)
->
AddChatMessage
(
-
1
,
"1"
)
;
_cp
=
true
;
}
else
{
sprintf
(
_text
,
"02D3: %d "
,
car
)
;
SF
->
getCLEO
(
)
->
callOpcode
(
_text
)
;
SF
->
getSAMP
(
)
->
getChat
(
)
->
AddChatMessage
(
-
1
,
"Middle"
)
;
}
}
else
if
(
color
==
0x366B2CFF
)
{
if
(
_cp
==
false
)
_cp
=
true
;
int
car
=
SF
->
getSAMP
(
)
->
getVehicles
(
)
->
GetCarHandleFromSAMPCarID
(
SF
->
getSAMP
(
)
->
getPlayers
(
)
->
pLocalPlayer
->
sCurrentVehicleID
)
;
char
_text
[
100
]
;
sprintf
(
_text
,
"02D3: %d %f %f %f"
,
car
,
pos
[
0
]
,
pos
[
1
]
,
pos
[
2
]
)
;
SF
->
getCLEO
(
)
->
callOpcode
(
_text
)
;
SF
->
getSAMP
(
)
->
getChat
(
)
->
AddChatMessage
(
-
1
,
"1"
)
;
}
}
char
_text
[
100
]
;
sprintf
(
_text
,
"%d %f %f %f %d %s"
,
iconid
,
pos
[
0
]
,
pos
[
1
]
,
pos
[
2
]
,
type
,
color
)
;
SF
->
getSAMP
(
)
->
getChat
(
)
->
AddChatMessage
(
-
1
,
_text
)
;
return
true
;
}
return
true
;
}
|
|
|

05.04.2021, 23:34
|
|
Флудер
Регистрация: 18.03.2013
Сообщений: 4,080
С нами:
6921957
Репутация:
183
|
|
WTF? It crash your gta.
C++:
Код:
sprintf
(
_text
,
"X"
,
car
,
pos
[
0
]
,
pos
[
1
]
,
pos
[
2
]
)
;
SF
->
getCLEO
(
)
->
callOpcode
(
_text
)
;
|
|
|

06.04.2021, 05:35
|
|
Новичок
Регистрация: 05.04.2021
Сообщений: 2
С нами:
2688352
Репутация:
1
|
|
I solved the problem. You can lock thread
|
|
|
|
 |
Предыдущая тема
Следующая тема
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|