Другое SAMPFUNCS | API C++

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,695
1,447
С переходами вряд ли.
Рендери отдельно строки убрав в них символ перехода
 
  • Нравится
Реакции: AWRage

Tray228

Новичок
218
27
PHP:
#include <windows.h>
#include <string>
#include <assert.h>
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
#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;
}
не скруллит почему?
 

nikita_cheater

Новичок
13
3
PHP:
#include <windows.h>
#include <string>
#include <assert.h>
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
#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 в мейнлупе, будет фризить игру
 

Gabriel__

Известный
Проверенный
411
181
Как выдать игроку джетпак ?
Как получить координаты маркера на карте ?

Как сделать в ATB что то типо чекбокса ? (ставить галочку включено/выключено)
 
Последнее редактирование модератором:

Gabriel__

Известный
Проверенный
411
181
Как проверить что игрок стреляет ? Помогите!
if (SF->getCLEO()->callOpcode("02E0: actor $PLAYER_ACTOR firing_weapon")) - Не работает. Всегда выдает true.
 

Gabriel__

Известный
Проверенный
411
181
1. Как отчистить чат ? SF->getSAMP()->getChat()-> - не нашел.
2. Как проверить что нажата левая кнопка мыши ?