
21.03.2016, 15:33
|
|
Новичок
Регистрация: 06.10.2015
Сообщений: 13
С нами:
5580077
Репутация:
0
|
|
Сообщение от Tray228
PHP:
Код:
#include
#include
#include
#include
#include
#include
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
#pragma comment (lib,"user32.lib")
SAMPFUNCS
*
SF
=
new
SAMPFUNCS
(
)
;
static
bool gun_rec
=
false
;
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
)
,
"SAMPFUNCS Plugin loaded."
)
;
init
=
true
;
}
if
(
SF
-
>
getGame
(
)
-
>
isKeyPressed
(
'R'
)
)
{
if
(
!
gun_rec
)
{
keybd_event
(
'E'
,
0
,
0
,
0
)
;
Sleep
(
200
)
;
keybd_event
(
'E'
,
0
,
KEYEVENTF_KEYUP
,
0
)
;
}
else
{
keybd_event
(
'Q'
,
0
,
0
,
0
)
;
Sleep
(
200
)
;
keybd_event
(
'Q'
,
0
,
KEYEVENTF_KEYUP
,
0
)
;
}
gun_rec
^
=
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
;
}
не скруллит почему?
Не юзай Sleep в мейнлупе, будет фризить игру
|
|
|