я бы твой плагин никогда себе не поставил из-за ебанутой системы админсчекераКод:#include <windows.h> #include <string> #include <assert.h> #include <process.h> #include "SAMPFUNCS_API.h" #include "game_api\game_api.h" SAMPFUNCS *SF = new SAMPFUNCS(); bool slonobot = false; bool adm = false; int GetPickup(int GtaPickupID) { if ( SF->getSAMP()->getInfo()->pPools->pPickup == NULL ) return 0; actor_info *self = SF->getGame()->actorInfoGet(ACTOR_SELF, ACTOR_ALIVE); if ( self != NULL ) { for ( int i = 0; i < SAMP_MAX_PICKUPS; i++ ) { if ( SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].iModelID == 0 ) continue; if ( SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].iType == 0 ) continue; if ( SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].fPosition[0] == NULL || SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].fPosition[1] == NULL || SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].fPosition[2] == NULL ) continue; int x = SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].iModelID; if(x == GtaPickupID) return i; } } return 0; } void Admin_Checker() { if(adm) { char admin_name[300][300]; FILE *file; char path[512]; sprintf(path, "SAMPFUNCS\\admins.ini"); file = fopen(path, "r"); if (file) { for (int i = 0; i < 300; i++) { char buf[24]; if (fgets(buf, 300, file)) sscanf(buf, "%s", admin_name[i]); else break; } } fclose(file); for(int i = 0; i < SAMP_MAX_PLAYERS; i++) { if (SF->getSAMP()->getPlayers()->iIsListed[i] != 1) continue; if (SF->getSAMP()->getPlayers()->pRemotePlayer[i] == NULL) continue; for(int x = 0; x < 300; x++) { if(SF->getSAMP()->getPlayers()->GetPlayerName(i) == NULL || admin_name[x] == NULL) break; if(!strcmp(SF->getSAMP()->getPlayers()->GetPlayerName(i), admin_name[x])) { if(SF->getSAMP()->getPlayers()->pRemotePlayer[i]->iScore > 0) { static int action = 0; static DWORD dwTime = GetTickCount(); if(action == 0) { if(GetPickup(1275)) { SF->getSAMP()->sendPickedUpPickup(GetPickup(1275)); action = 1; } } if(action == 1) { if(dwTime < GetTickCount() - 1000) { if(SF->getSAMP()->getDialog()->iIsActive) { if(SF->getSAMP()->getDialog()->DialogID == 110) { SF->getSAMP()->getDialog()->Close(1); action = 2; dwTime = GetTickCount(); } } else { action = 0; dwTime = GetTickCount(); } } } if(action == 2 && dwTime < GetTickCount() - 1000) { SF->getRakNet()->getRakClient()->Disconnect(500); SF->getSAMP()->getInfo()->RestartGame(); SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 255, 0), "В игру зашел админ, бот завершил свою работу."); slonobot = false; adm = false; action = 0; dwTime = GetTickCount(); } } } } } } } void SlonoBot() { static DWORD dwTime = GetTickCount(); static int action = 0; static int count = 0; static int count_action = 0; if(slonobot && action == 0 && dwTime < GetTickCount() - 500) { float coord[3] = {-1859.45, -1625.72, -78.00}; actor_info *info = SF->getGame()->actorInfoGet(ACTOR_SELF, ACTOR_ALIVE); info->base.matrix[4 * 3] = coord[0]; info->base.matrix[4 * 3 + 1] = coord[1]; info->base.matrix[4 * 3 + 2] = coord[2]; if(count >= 20) { if(count_action == 0) { if(GetPickup(1275)) { SF->getSAMP()->sendPickedUpPickup(GetPickup(1275)); count_action = 1; } } if(count_action == 1) { if(SF->getSAMP()->getDialog()->iIsActive) { if(SF->getSAMP()->getDialog()->DialogID == 110 || SF->getSAMP()->getDialog()->DialogID == 109) { SF->getSAMP()->getDialog()->Close(1); count_action = 2; } } } if(count_action == 2 && dwTime < GetTickCount() - 1000) { if(GetPickup(1275)) { SF->getSAMP()->sendPickedUpPickup(GetPickup(1275)); count_action = 3; dwTime = GetTickCount(); } } if(count_action == 3) { if(SF->getSAMP()->getDialog()->iIsActive) { if(SF->getSAMP()->getDialog()->DialogID == 110 || SF->getSAMP()->getDialog()->DialogID == 109) { SF->getSAMP()->getDialog()->Close(1); count_action = 0; count = 0; action = 1; dwTime = GetTickCount(); } } } } else { action = 1; dwTime = GetTickCount(); } } if(slonobot && action == 1) { if(SF->getSAMP()->getPlayers()->pLocalPlayer->sCurrentAnimID == 616) { action = 2; dwTime = GetTickCount(); } } if(slonobot && action == 2) { if(dwTime < GetTickCount() - 6500) { float pos[3] = {-1866.83, -1612.35, 21.76}; BitStream bsOnfootSync; stOnFootData ofSync; memset(&ofSync, 0, sizeof(stOnFootData)); ofSync.byteArmor = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.byteArmor; ofSync.byteCurrentWeapon = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.byteCurrentWeapon; ofSync.byteHealth = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.byteHealth; ofSync.byteSpecialAction = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.byteSpecialAction; ofSync.fMoveSpeed[0] = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.fMoveSpeed[0]; ofSync.fMoveSpeed[1] = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.fMoveSpeed[1]; ofSync.fMoveSpeed[2] = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.fMoveSpeed[2]; ofSync.fPosition[0] = pos[0]; ofSync.fPosition[1] = pos[1]; ofSync.fPosition[2] = pos[2]; ofSync.fQuaternion[0] = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.fQuaternion[0]; ofSync.fQuaternion[1] = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.fQuaternion[1]; ofSync.fQuaternion[2] = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.fQuaternion[2]; ofSync.fQuaternion[3] = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.fQuaternion[3]; ofSync.fSurfingOffsets[0] = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.fSurfingOffsets[0]; ofSync.fSurfingOffsets[1] = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.fSurfingOffsets[1]; ofSync.fSurfingOffsets[2] = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.fSurfingOffsets[2]; ofSync.sAnimFlags = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.sAnimFlags; ofSync.sCurrentAnimationID = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.sCurrentAnimationID; ofSync.sKeys = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.sKeys; ofSync.sLeftRightKeys = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.sLeftRightKeys; ofSync.sSurfingVehicleID = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.sSurfingVehicleID; ofSync.stSampKeys = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.stSampKeys; ofSync.sUpDownKeys = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData.sUpDownKeys; bsOnfootSync.Write((BYTE)ID_PLAYER_SYNC); bsOnfootSync.Write((PCHAR)&ofSync, sizeof(stOnFootData)); SF->getRakNet()->SendPacket(&bsOnfootSync); action = 0; count++; dwTime = GetTickCount(); } } } void CALLBACK zp(std::string param) { if ( SF->getSAMP()->getInfo()->pPools->pPickup == NULL ) return; actor_info *self = SF->getGame()->actorInfoGet(ACTOR_SELF, ACTOR_ALIVE); if ( self != NULL ) { for ( int i = 0; i < SAMP_MAX_PICKUPS; i++ ) { if ( SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].iModelID == 0 ) continue; if ( SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].iType == 0 ) continue; if ( SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].fPosition[0] == NULL || SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].fPosition[1] == NULL || SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].fPosition[2] == NULL ) continue; int x = SF->getSAMP()->getInfo()->pPools->pPickup->pickup[i].iModelID; if(x == 1275) { BitStream bsPickup; bsPickup.Write( i ); SF->getRakNet()->SendRPC(RPC_PickedUpPickup, &bsPickup); SF->getRakNet()->SendRPC(RPC_PickedUpPickup, &bsPickup); break; } } } } void CALLBACK cmd(std::string param) { SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 255, 0), "Выключить/Выключить бота | {0000FF}/slonobot"); SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 255, 0), "Посмотреть команды | {0000FF}/comands"); SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 255, 0), "Завершить работу | {0000FF}/zp"); SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 255, 0), "Автовыключение, если админ в сети | {0000FF}/adm"); } void CALLBACK Adm(std::string param) { if (adm == false) { adm = true; SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 255, 0), "Автовыключение при входе админа | {00FF00}Включено"); } else { adm = false; SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 255, 0), "Автовыключение при входе админа | {FF0000}Выключено"); } } void CALLBACK boton(std::string param) { if (slonobot == false) { slonobot = true; SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 255, 0), "Бот шахтера by slonoboyko для Advance RP | {00FF00}Запущен"); } else { slonobot = false; SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 255, 0), "Бот шахтера by slonoboyko для Advance RP | {FF0000}Остановлен"); } } 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()->getChat()->AddChatMessage( D3DCOLOR_XRGB( 255, 255, 0), "[SlonoBot] Бот шахтера от SlonoBoyko успешно загружен." ); SF->getSAMP()->getChat()->AddChatMessage( D3DCOLOR_XRGB( 255, 255, 0 ), "[SlonoBot] Чтобы посмотреть команды введи /comands." ); SF->getSAMP()->registerChatCommand("slonobot", boton); SF->getSAMP()->registerChatCommand("comands", cmd); SF->getSAMP()->registerChatCommand("zp", zp); SF->getSAMP()->registerChatCommand("adm", Adm); init = true; } else { Admin_Checker(); SlonoBot(); } } 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; }
Вроде я радио нигде не включаю.
Реально, мистика какая то, я сам вахуе.
Снуп дог хуярит, ахуеть.
Последнее редактирование: