BonesGrocerys
Новичок
- 2
- 0
перед инклюдами - #define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGSПытаюсь сделать по уроку urShadow , что не так?
Посмотреть вложение 20373
Скрин лога компилятора.в чем проблема? скачал готовый проект в топике с сампфунксом, при компилировании в папке bin никаких .sf файлов не нашел.
как отправить сообщение в чат? на подобии sampSendChat в луа
stLocalPlayer *lp = SF->getSAMP()->getPlayers()->pLocalPlayer;
lp->Say("Mamku ebal");
как отследить выбранный пункт диалога? если допустим второй пункт писало в чат "Выбран второй пункт"
typedef struct
{
WORD DialogID;
BYTE ButtonID;
WORD ListItem;
BYTE Length;
char* Text;
} DlgResponce;
bool __stdcall OutRPC(stRakNetHookParams *hook)
{
if (hook->packetId == RPCEnumeration::RPC_DialogResponse)
{
DlgResponce DlgData;
hook->bitStream->ResetReadPointer();
hook->bitStream->IgnoreBits(8);
hook->bitStream->Read(DlgData.DialogID);
hook->bitStream->Read(DlgData.ButtonID);
hook->bitStream->Read(DlgData.ListItem);
hook->bitStream->Read(DlgData.Length);
hook->bitStream->Read(DlgData.Text, DlgData.Length);
hook->bitStream->ResetReadPointer();
if (DlgData.ListItem == 1)
{
SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(148, 112, 255),
"{07DA5B}Выбран второй пункт диалога!");
}
}
return true;
}
void __stdcall mainloop(void)
{
static bool init = false;
if(!init)
{
if (GAME == nullptr) return;
if (GAME->GetSystemState() != eSystemState::GS_PLAYING_GAME) return;
if(!SF->getSAMP()->IsInitialized()) return;
SF->getRakNet()->registerRakNetCallback(RAKHOOK_TYPE_OUTCOMING_RPC, OutRPC);
init = true;
}
}
void EmulKey()
{
stOnFootData sync;
memset(&sync, 0, sizeof(stOnFootData));
sync = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData;
sync.byteCurrentWeapon = 1024;
BitStream bsActorSync;
bsActorSync.Write((BYTE)ID_PLAYER_SYNC);
bsActorSync.Write((PCHAR)&sync, sizeof(stOnFootData));
SF->getRakNet()->SendPacket(&bsActorSync);
memset(&bsActorSync, 0, sizeof(BitStream));
sync.byteCurrentWeapon = 0;
bsActorSync.Write((BYTE)ID_PLAYER_SYNC);
bsActorSync.Write((PCHAR)&sync, sizeof(stOnFootData));
SF->getRakNet()->SendPacket(&bsActorSync);
}
[18:46:08.431] Params parsing error: unknown type (longstring:command).
[18:46:08.448] Session started on 24.10.2018-18.46.08.
[18:46:08.711] < [Packet Send] ID_PLAYER_SYNC[207](length: 69 bytes, 552 bits, priority: 1, reliability: 7, orderingChannel: 1)
< params:
leftRightKeys: 0 (0x0)
upDownKeys: 0 (0x0)
keys: 0 (0x0)
position: -2032.97, 161.691, 29.0461
quat: 0.737129, -0, 0, -0.675752
health: 78 (0x4E)
armor: 0 (0x0)
weapon: 0 (0x0)
specialAction: 0 (0x0)
moveSpeed: 0, 0, 0
surfOffs: 0, 0, 0
surfId: 0 (0x0)
animId: 1189 (0x4A5)
animFlags: 32772 (0x8004)
unreadBits: 0
[18:46:08.924] < [Packet Send] ID_PLAYER_SYNC[207](length: 69 bytes, 552 bits, priority: 1, reliability: 7, orderingChannel: 1)
< params:
leftRightKeys: 0 (0x0)
upDownKeys: 0 (0x0)
keys: 1024 (0x400)
position: -2032.97, 161.691, 29.0461
quat: 0.737129, -0, 0, -0.675752
health: 78 (0x4E)
armor: 0 (0x0)
weapon: 0 (0x0)
specialAction: 0 (0x0)
moveSpeed: 0, 0, 0
surfOffs: 0, 0, 0
surfId: 0 (0x0)
animId: 1189 (0x4A5)
animFlags: 32772 (0x8004)
unreadBits: 0
[18:46:09.024] < [Packet Send] ID_PLAYER_SYNC[207](length: 69 bytes, 552 bits, priority: 1, reliability: 7, orderingChannel: 1)
< params:
leftRightKeys: 0 (0x0)
upDownKeys: 0 (0x0)
keys: 0 (0x0)
position: -2032.97, 161.691, 29.0461
quat: 0.737129, -0, 0, -0.675752
health: 78 (0x4E)
armor: 0 (0x0)
weapon: 0 (0x0)
specialAction: 0 (0x0)
moveSpeed: 0, 0, 0
surfOffs: 0, 0, 0
surfId: 0 (0x0)
animId: 1189 (0x4A5)
animFlags: 32772 (0x8004)
unreadBits: 0
[18:46:09.281] < [RPC Send] RPC_SetInteriorId[118](length: 1 bytes, 8 bits, priority: 1, reliability: 8, orderingChannel: 0)
[18:46:09.352] < [Packet Send] ID_PLAYER_SYNC[207](length: 69 bytes, 552 bits, priority: 1, reliability: 7, orderingChannel: 1)
< params:
leftRightKeys: 0 (0x0)
upDownKeys: 0 (0x0)
keys: 0 (0x0)
position: 671.689, -579.067, 1700.74
quat: 0.737129, -0, 0, -0.675752
health: 78 (0x4E)
armor: 0 (0x0)
weapon: 0 (0x0)
specialAction: 0 (0x0)
moveSpeed: 0, 0, 0
surfOffs: 0, 0, 0
surfId: 0 (0x0)
animId: 1189 (0x4A5)
animFlags: 32776 (0x8008)
unreadBits: 0
[18:46:09.399] < [Packet Send] ID_STATS_UPDATE[205](length: 9 bytes, 72 bits, priority: 1, reliability: 6, orderingChannel: 0)
< params:
money: 14463447 (0xDCB1D7)
ammo: 0 (0x0)
unreadBits: 0
[18:46:09.399] < [Packet Send] ID_AIM_SYNC[203](length: 32 bytes, 256 bits, priority: 1, reliability: 7, orderingChannel: 1)
< params:
camMode: 4 (0x4)
target: -0.985046, 0.0857453, -0.149438
position: 675.136, -579.367, 1701.86
zAngle: 0.0000
weapState: 63 (0x3F)
unknown: 85 (0x55)
unreadBits: 0
[18:46:09.945] < [Packet Send] ID_PLAYER_SYNC[207](length: 69 bytes, 552 bits, priority: 1, reliability: 7, orderingChannel: 1)
< params:
leftRightKeys: 0 (0x0)
upDownKeys: 0 (0x0)
keys: 0 (0x0)
position: 671.689, -579.067, 1700.74
quat: 0.737129, -0, 0, -0.675752
health: 78 (0x4E)
armor: 0 (0x0)
weapon: 0 (0x0)
specialAction: 0 (0x0)
moveSpeed: 0, 0, 0
surfOffs: 0, 0, 0
surfId: 0 (0x0)
animId: 1189 (0x4A5)
animFlags: 32776 (0x8008)
unreadBits: 0
[18:46:10.424] < [Packet Send] ID_STATS_UPDATE[205](length: 9 bytes, 72 bits, priority: 1, reliability: 6, orderingChannel: 0)
< params:
money: 14463447 (0xDCB1D7)
ammo: 0 (0x0)
unreadBits: 0
вместоПодскажите, как эмулировать нажатие клавиши "ALT". Сам побывал ничего не выходит.
C++:void EmulKey() { stOnFootData sync; memset(&sync, 0, sizeof(stOnFootData)); sync = SF->getSAMP()->getPlayers()->pLocalPlayer->onFootData; sync.byteCurrentWeapon = 1024; BitStream bsActorSync; bsActorSync.Write((BYTE)ID_PLAYER_SYNC); bsActorSync.Write((PCHAR)&sync, sizeof(stOnFootData)); SF->getRakNet()->SendPacket(&bsActorSync); memset(&bsActorSync, 0, sizeof(BitStream)); sync.byteCurrentWeapon = 0; bsActorSync.Write((BYTE)ID_PLAYER_SYNC); bsActorSync.Write((PCHAR)&sync, sizeof(stOnFootData)); SF->getRakNet()->SendPacket(&bsActorSync); }
sync.byteCurrentWeapon = 1024;
sync.sKeys = 1024;
sync.stSampKeys.keys_unknown__walkSlow = 1; // если keys будет мало
It`s because plugin is unlinked in SAMPFUNCS.asi, write your own injector wich will be call loadPlugin method from SAMPFUNCS.asi export.Hello, could you help me?
I was trying to inject .sf (sampfuncs) file into gta_sa process. If code contained i.e. Log("some text") it was injected succesfully, however If code contained i.e. AddChatMessage(-1,"some text") injection was unsucces and obviously whole game crashed. Is there any way of injecting my code or is it possible to use sampfuncs library in .asi/.dll so, when I want to use cheat by injection I don't have to rewrite whole code?
Thanks for advice. Have a good day!
P.S.: I injected it after the spawn, so whole samp was fully loaded.