HOME FORUMS MEMBERS RECENT POSTS LOG IN  
× Авторизация
Имя пользователя:
Пароль:
Нет аккаунта? Регистрация
Баннер 1   Баннер 2
НОВЫЕ ТОРГОВАЯ НОВОСТИ ЧАТ
loading...
Скрыть
Вернуться   ANTICHAT > ПРОГРАММИРОВАНИЕ > С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby
   
Ответ
 
Опции темы Поиск в этой теме Опции просмотра

  #1701  
Старый 23.07.2016, 11:14
iAmerican
Постоянный
Регистрация: 17.02.2014
Сообщений: 611
С нами: 6438231

Репутация: 133


По умолчанию

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

Как плагин в энигме упаковать?
Тебе так принципиально енигмой?
 
Ответить с цитированием

  #1702  
Старый 24.07.2016, 00:32
BlackKnigga
Постоянный
Регистрация: 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
(
)
)
;
}
;
}


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

  #1703  
Старый 24.07.2016, 12:39
Dark_Knight
Флудер
Регистрация: 18.03.2013
Сообщений: 4,080
С нами: 6921957

Репутация: 183


По умолчанию

весь код.
 
Ответить с цитированием

  #1704  
Старый 24.07.2016, 13:02
BlackKnigga
Постоянный
Регистрация: 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
;
}


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

  #1705  
Старый 24.07.2016, 14:19
SR_team
Флудер
Регистрация: 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 и в нем пиши свой код
 
Ответить с цитированием

  #1706  
Старый 25.07.2016, 02:11
BlackKnigga
Постоянный
Регистрация: 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
;
}


Мб компилирую как то не правильно?
 
Ответить с цитированием

  #1707  
Старый 25.07.2016, 14:23
SR_team
Флудер
Регистрация: 26.10.2013
Сообщений: 4,924
С нами: 6603505

Репутация: 183


По умолчанию

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

strrev(msg);
char *nick = strtok(msg, " ");
это что за еботня?
 
Ответить с цитированием

  #1708  
Старый 25.07.2016, 19:26
tropical5466
Новичок
Регистрация: 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;
}
 
Ответить с цитированием

  #1709  
Старый 25.07.2016, 19:29
itsLegend
Флудер
Регистрация: 23.03.2013
Сообщений: 2,696
С нами: 6915558

Репутация: 183


По умолчанию

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

Все так же
Мб компилирую как то не правильно?
SAMPFUNCS.log скинь
 
Ответить с цитированием

  #1710  
Старый 27.07.2016, 02:46
Woofing Giraffe
Постоянный
Регистрация: 14.06.2015
Сообщений: 402
С нами: 5744580

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

Как проверить локального игрока на АФК?
 
Ответить с цитированием
Ответ





Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


Быстрый переход




ANTICHAT ™ © 2001- Antichat Kft.

×

Создать сделку

Продавец: ник или ID

Название сделки:

Сумма USDT:

Срок сделки, дней:

Кто платит комиссию:

Условия сделки:

После создания сделки средства будут зарезервированы в холде до завершения сделки.

×

Мои сделки

Загрузка...
×

Сделка


Загрузка чата...