ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   Общие вопросы программирования (https://forum.antichat.xyz/forumdisplay.php?f=206)
-   -   SF | Crashes when actor spawn (Help) (https://forum.antichat.xyz/showthread.php?t=1383838)

TheRedLion 05.04.2021 22:26

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
;
}


Dark_Knight 05.04.2021 23:34

WTF? It crash your gta.

C++:





Код:

sprintf
(
_text
,
"X"
,
car
,
pos
[
0
]
,
pos
[
1
]
,
pos
[
2
]
)
;
SF
->
getCLEO
(
)
->
callOpcode
(
_text
)
;


TheRedLion 06.04.2021 05:35

I solved the problem. You can lock thread


Время: 15:05