#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
#include <windows.h>
#include <string>
#include <assert.h>
#include <process.h>
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
bool STATUS;
SAMPFUNCS *SF = new SAMPFUNCS();
stOnFootData sync;
void CALLBACK cmd(std::string param)
{
STATUS ^= true;
memset(&sync, 0, sizeof(stOnFootData) && STATUS == true );
sync = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData;
BitStream sCurrentAnimID;
BitStream sAnimFlags;
sCurrentAnimID.Write((BYTE)ID_PLAYER_SYNC);
sCurrentAnimID.Write((PCHAR)&sync, sizeof(stOnFootData));
sAnimFlags.Write((BYTE)ID_PLAYER_SYNC);
sAnimFlags.Write((PCHAR)&sync, sizeof(stOnFootData));
SF->getRakNet()->SendPacket(&sCurrentAnimID);
SF->getRakNet()->SendPacket(&sAnimFlags);
};
void CALLBACK mainloop()
{
static bool init = false;
if (!init)
{
if (GAME == nullptr)
return;
if (GAME->GetSystemState() != eSystemState::GS_PLAYING_GAME)
return;
GAME->GetAudio()->PlayBeatTrack(2);
if (!SF->getSAMP()->IsInitialized())
return;
SF->getSAMP()->registerChatCommand("sbiv", cmd);
SF->LogConsole("{FF0000}[SFPlugin] {FFFFFF}загужен by Tray228");
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;
}