local EVENTS = require("lib.samp.events")
local sha = require("sha2")
function main()
sampRegisterChatCommand("la", function(stringA) -- stringA = password
lua_thread.create(function()
sampAddChatMessage("_| SEND_AUTH_PACKET |_", -1)
local BITSTREAM = raknetNewBitStream()
raknetBitStreamWriteInt8(BITSTREAM, 252)
raknetBitStreamWriteInt8(BITSTREAM, 1)
raknetBitStreamWriteInt8(BITSTREAM, string.len(stringA))
raknetBitStreamWriteString(BITSTREAM, stringA)
raknetSendBitStreamEx(BITSTREAM, 1, 7, 1)
raknetDeleteBitStream(BITSTREAM)
end)
end)
sampRegisterChatCommand("lr", function(stringA) -- stringA = password
sampAddChatMessage("_| SEND_REGISTER_PACKET |_", -1)
local BITSTREAM = raknetNewBitStream()
raknetBitStreamWriteInt8(BITSTREAM, 252)
raknetBitStreamWriteInt8(BITSTREAM, 2)
raknetBitStreamWriteInt8(BITSTREAM, string.len(stringA))
raknetBitStreamWriteInt8(BITSTREAM, string.len(sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(playerPed)))))
raknetBitStreamWriteString(BITSTREAM, stringA)
raknetBitStreamWriteString(BITSTREAM, sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(playerPed))))
raknetBitStreamWriteInt8(BITSTREAM, 1)
raknetBitStreamWriteInt8(BITSTREAM, 1)
raknetSendBitStreamEx(BITSTREAM, 1, 7, 1)
raknetDeleteBitStream(BITSTREAM)
local BITSTREAM = raknetNewBitStream()
raknetBitStreamWriteInt8(BITSTREAM, 252)
raknetBitStreamWriteInt8(BITSTREAM, 3)
raknetBitStreamWriteInt32(BITSTREAM, 1)
raknetSendBitStreamEx(BITSTREAM, 1, 7, 1)
raknetDeleteBitStream(BITSTREAM)
end)
sampRegisterChatCommand("dona", function()
sampAddChatMessage("SENT DONATE", -1)
local BITSTREAM = raknetNewBitStream()
raknetBitStreamWriteInt8(BITSTREAM, 251)
raknetBitStreamWriteInt8(BITSTREAM, 70)
raknetBitStreamWriteInt8(BITSTREAM, 2)
raknetBitStreamWriteInt8(BITSTREAM, 3)
raknetBitStreamWriteInt16(BITSTREAM, 1)
raknetBitStreamWriteInt16(BITSTREAM, 1)
raknetSendBitStreamEx(BITSTREAM, 1, 7, 1)
raknetDeleteBitStream(BITSTREAM)
end)
wait(-1)
end
function onReceivePacket(ID, BS)
if(ID == 251) then
raknetBitStreamIgnoreBits(BS, 8)
local BTYPE = raknetBitStreamReadInt32(BS)
if(BTYPE == 46) then
local BITSTREAM = raknetNewBitStream()
raknetBitStreamWriteInt8(BITSTREAM, 251)
raknetBitStreamWriteInt8(BITSTREAM, 90)
raknetBitStreamWriteInt8(BITSTREAM, 1)
raknetSendBitStreamEx(BITSTREAM, 1, 7, 1)
raknetDeleteBitStream(BITSTREAM)
local BITSTREAM = raknetNewBitStream()
raknetBitStreamWriteInt8(BITSTREAM, 251)
raknetBitStreamWriteInt8(BITSTREAM, 79)
raknetSendBitStreamEx(BITSTREAM, 1, 7, 1)
raknetDeleteBitStream(BITSTREAM)
local STR_L = raknetBitStreamReadInt16(BS)
local STR = raknetBitStreamReadString(BS, STR_L)
sampAddChatMessage(STR, -1)
local HASH = sha.sha256(string.format("%s%s", "447777Tygfda", STR))
local BITSTREAM = raknetNewBitStream()
raknetBitStreamWriteInt8(BITSTREAM, 251)
raknetBitStreamWriteInt8(BITSTREAM, 46)
raknetBitStreamWriteInt16(BITSTREAM, string.len(HASH))
raknetBitStreamWriteString(BITSTREAM, HASH)
raknetSendBitStreamEx(BITSTREAM, 1, 7, 1)
raknetDeleteBitStream(BITSTREAM)
end
if(BTYPE == 26) then
local NF_STATE = raknetBitStreamReadInt16(BS)
if(NF_STATE == 65535) then
sampAddChatMessage("NOTIFY HIDE!", -1)
return false
end
local NF_LEN = raknetBitStreamReadInt8(BS)
local NF = raknetBitStreamReadString(BS, NF_LEN)
raknetBitStreamIgnoreBits(BS, 24)
local NF_LEN_FB = raknetBitStreamReadInt8(BS)
local NS_FB = raknetBitStreamReadString(BS, NF_LEN_FB)
local NF_LEN_SB = raknetBitStreamReadInt8(BS)
local NF_SB = raknetBitStreamReadString(BS, NF_LEN_SB)
sampAddChatMessage(string.format("[%d] NOTIF: %s (%s) (%s)", NF_STATE, NF, NS_FB, NF_SB), -1)
end
end
end
function EVENTS.onSendClientJoin(version, mod, nickname, challengeResponse, joinAuthKey, clientVer, challengeResponse2)
return { 4057, 1, nickname, challengeResponse, "E02262CF28BC542486C558D4BE9EFB716592AFAF8B", "0.3.7", challengeResponse2 }
end