
07.03.2016, 15:32
|
|
Участник форума
Регистрация: 09.03.2015
Сообщений: 218
С нами:
5884065
Репутация:
0
|
|
Почему не убирается перезарядка?
PHP:
Код:
#include
#include
#include
#include
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
SAMPFUNCS
*
SF
=
new
SAMPFUNCS
(
)
;
bool act
=
false
;
DWORD
timer
;
DWORD
tm
=
GetTickCount
(
)
;
bool
CALLBACK
outcomingData
(
stRakNetHookParams
*
params
)
{
if
(
params
-
>
packetId
==
PacketEnumeration
:
:
ID_BULLET_SYNC
&&
act
==
true
)
{
if
(
SF
-
>
getSAMP
(
)
-
>
getPlayers
(
)
-
>
pLocalPlayer
-
>
byteCurrentWeapon
==
25
)
{
if
(
tm
GiveWeapon
(
(
eWeaponType
)
25
,
0
,
WEAPONSKILL_PRO
)
;
}
}
}
return
true
;
}
void
CALLBACK
heh
(
std
:
:
string param
)
{
act
^
=
true
;
}
void
CALLBACK
mainloop
(
)
{
static
bool init
=
false
;
if
(
!
init
)
{
if
(
GAME
==
nullptr
)
return
;
if
(
GAME
-
>
GetSystemState
(
)
!=
eSystemState
:
:
GS_PLAYING_GAME
)
return
;
if
(
!
SF
-
>
getSAMP
(
)
-
>
IsInitialized
(
)
)
return
;
SF
-
>
getSAMP
(
)
-
>
getChat
(
)
-
>
AddChatMessage
(
D3DCOLOR_XRGB
(
0
,
0xAA
,
0
)
,
"macro"
)
;
SF
-
>
getRakNet
(
)
-
>
registerRakNetCallback
(
RakNetScriptHookType
:
:
RAKHOOK_TYPE_OUTCOMING_PACKET
,
outcomingData
)
;
SF
-
>
getSAMP
(
)
-
>
registerChatCommand
(
"macro"
,
heh
)
;
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
;
}
|
|
|