 |
|

23.07.2016, 11:14
|
|
Постоянный
Регистрация: 17.02.2014
Сообщений: 611
С нами:
6438231
Репутация:
133
|
|
Сообщение от Tray228
Как плагин в энигме упаковать?
Тебе так принципиально енигмой?
|
|
|

24.07.2016, 00:32
|
|
Постоянный
Регистрация: 10.01.2016
Сообщений: 922
С нами:
5441999
Репутация:
133
|
|
Гружу пустой плагин сф - нормально грузится. Добавляю немного кода - Plugin not found. Что не так?
Сообщение от Спойлер
C++:
Код:
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
(
9
)
)
{
std
::
string string
=
SF
->
getSAMP
(
)
->
getChat
(
)
->
GetChatInputText
(
)
;
SF
->
Log
(
string
.
c_str
(
)
)
;
}
;
}
|
|
|

24.07.2016, 12:39
|
|
Флудер
Регистрация: 18.03.2013
Сообщений: 4,080
С нами:
6921957
Репутация:
183
|
|
весь код.
|
|
|

24.07.2016, 13:02
|
|
Постоянный
Регистрация: 10.01.2016
Сообщений: 922
С нами:
5441999
Репутация:
133
|
|
Сообщение от Dark_Knight
весь код.
Так это и есть весь код цикла mainloop. Ну если надо:
Сообщение от Спойлер
C++:
Код:
#include
#include
#include
#include
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
SAMPFUNCS
*
SF
=
new
SAMPFUNCS
(
)
;
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
(
9
)
)
{
std
::
string string
=
SF
->
getSAMP
(
)
->
getChat
(
)
->
GetChatInputText
(
)
;
SF
->
Log
(
string
.
c_str
(
)
)
;
}
;
}
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
;
}
|
|
|

24.07.2016, 14:19
|
|
Флудер
Регистрация: 26.10.2013
Сообщений: 4,924
С нами:
6603505
Репутация:
183
|
|
Сообщение от BlackKnigga
Гружу пустой плагин сф - нормально грузится. Добавляю немного кода - Plugin not found. Что не так?
Сообщение от Спойлер
C++:
Код:
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
(
9
)
)
{
std
::
string string
=
SF
->
getSAMP
(
)
->
getChat
(
)
->
GetChatInputText
(
)
;
SF
->
Log
(
string
.
c_str
(
)
)
;
}
;
}
ты isKeyPressed вызываешь до инициализации. После условия if (!init), в конце, добавь else и в нем пиши свой код
|
|
|

25.07.2016, 02:11
|
|
Постоянный
Регистрация: 10.01.2016
Сообщений: 922
С нами:
5441999
Репутация:
133
|
|
Сообщение от SR_team
ты isKeyPressed вызываешь до инициализации. После условия if (!init), в конце, добавь else и в нем пиши свой код
Все так же
Сообщение от Спойлер
C++:
Код:
#include
#include
#include
#include
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
SAMPFUNCS
*
SF
=
new
SAMPFUNCS
(
)
;
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
;
}
else
{
if
(
SF
->
getGame
(
)
->
isKeyPressed
(
9
)
&&
SF
->
getSAMP
(
)
->
getInput
(
)
->
iInputEnabled
)
{
std
::
string string
;
string
=
SF
->
getSAMP
(
)
->
getChat
(
)
->
GetChatInputText
(
)
;
char
*
msg
=
new
char
[
string
.
length
(
)
+
1
]
;
strrev
(
msg
)
;
char
*
nick
=
strtok
(
msg
,
" "
)
;
SF
->
Log
(
nick
)
;
}
}
}
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
;
}
Мб компилирую как то не правильно?
|
|
|

25.07.2016, 14:23
|
|
Флудер
Регистрация: 26.10.2013
Сообщений: 4,924
С нами:
6603505
Репутация:
183
|
|
Сообщение от BlackKnigga
strrev(msg);
char *nick = strtok(msg, " ");
это что за еботня?
|
|
|

25.07.2016, 19:26
|
|
Новичок
Регистрация: 08.09.2013
Сообщений: 28
С нами:
6671670
Репутация:
53
|
|
Сообщение от BlackKnigga
Все так же
Сообщение от Спойлер
C++:
Код:
#include
#include
#include
#include
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
SAMPFUNCS
*
SF
=
new
SAMPFUNCS
(
)
;
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
;
}
else
{
if
(
SF
->
getGame
(
)
->
isKeyPressed
(
9
)
&&
SF
->
getSAMP
(
)
->
getInput
(
)
->
iInputEnabled
)
{
std
::
string string
;
string
=
SF
->
getSAMP
(
)
->
getChat
(
)
->
GetChatInputText
(
)
;
char
*
msg
=
new
char
[
string
.
length
(
)
+
1
]
;
strrev
(
msg
)
;
char
*
nick
=
strtok
(
msg
,
" "
)
;
SF
->
Log
(
nick
)
;
}
}
}
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
;
}
Мб компилирую как то не правильно?
Код:
Код:
#include
#include
#include
#include
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
SAMPFUNCS *SF = new SAMPFUNCS();
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(9) && SF->getSAMP()->getInput()->iInputEnabled)
{
std::string string;
string = SF->getSAMP()->getChat()->GetChatInputText();
char *msg = new char[string.length() + 1];
strrev(msg);
char *nick = strtok(msg, " ");
SF->Log(nick);
}
}
}
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;
}
|
|
|

25.07.2016, 19:29
|
|
Флудер
Регистрация: 23.03.2013
Сообщений: 2,696
С нами:
6915558
Репутация:
183
|
|
Сообщение от BlackKnigga
Все так же
Мб компилирую как то не правильно?
SAMPFUNCS.log скинь
|
|
|

27.07.2016, 02:46
|
|
Постоянный
Регистрация: 14.06.2015
Сообщений: 402
С нами:
5744580
Репутация:
28
|
|
Как проверить локального игрока на АФК?
|
|
|
|
 |
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|