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

  #3  
Старый 29.10.2015, 09:16
RakNet
Новичок
Регистрация: 06.10.2015
Сообщений: 25
С нами: 5581023

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

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

Чет не компилит даже)

C++:





Код:
#include 
#include 
#include 
#include 
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
SAMPFUNCS
*
SF
=
new
SAMPFUNCS
(
)
;
bool
CALLBACK
cbug
(
stRakNetHookParams
*
params
)
{
if
(
params
->
packetId
==
PacketEnumeration
::
ID_BULLET_SYNC
)
{
float
x
=
PEDSELF
->
GetPosition
(
)
->
fX
;
float
y
=
PEDSELF
->
GetPosition
(
)
->
fY
;
float
z
=
PEDSELF
->
GetPosition
(
)
->
fZ
;
Sleep
(
50
)
;
PEDSELF
->
Teleport
(
x
,
y
,
z
)
;
}
return
;
}
void
CALLBACK
mainloop
(
)
{
static
bool
init
=
false
;
if
(
!
init
)
{
if
(
GAME
==
nullptr
)
return
;
if
(
!
SF
->
getSAMP
(
)
->
IsInitialized
(
)
)
return
;
SF
->
getRakNet
(
)
->
registerRakNetCallback
(
RakNetScriptHookType
::
RAKHOOK_TYPE_OUTCOMING_PACKET
,
cbug
)
;
init
=
true
;
}
}
BOOL APIENTRY
DllMain
(
HMODULE hModule
,
DWORD dwReasonForCall
,
LPVOID lpReserved
)
{
switch
(
dwReasonForCall
)
{
case
DLL_PROCESS_ATTACH
:
SF
->
initPlugin
(
mainloop
,
hModule
)
;
break
;
case
DLL_THREAD_ATTACH
:
case
DLL_THREAD_DETACH
:
case
DLL_PROCESS_DETACH
:
break
;
}
return
TRUE
;
}

PEDSELF->Teleport(x, y, z);

}

return 0;

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