pa$$Ter
-
Автор темы
- #1
Код:
local ffi = require("ffi")
local FindElement = ffi.cast("unsigned long(__thiscall*)(void*, const char*)", Utils.PatternScan("client.dll", "55 8B EC 53 8B 5D 08 56 57 8B F9 33 F6 39 77 28"))
local CHudChat = FindElement(ffi.cast("unsigned long**", ffi.cast("uintptr_t", Utils.PatternScan("client.dll", "B9 ? ? ? ? E8 ? ? ? ? 8B 5D 08")) + 1)[0], "CHudChat")
local FFI_ChatPrint = ffi.cast("void(__cdecl*)(int, int, int, const char*, ...)", ffi.cast("void***", CHudChat)[0][27])
local function PrintInChat(text)
FFI_ChatPrint(CHudChat, 0, 0, string.format("%s ", text))
end
local menuCombo = Menu.Combo("Vote Revealer", "Vote revealer style", {"[YES], [NO]", "[1], [0]"}, 0)
local localName = CVar.FindVar("name")
local function main(event)
if event:GetName() == 'vote_cast' then
vote = event:GetInt("vote_option")
entID = event:GetInt("entityid")
local entity = EntityList.GetClientEntity(entID)
local player = entity:GetPlayer()
local playerName = player:GetName()
if vote == 0 then vote = 'Yes' else vote = 'No' end
Cheat.AddNotify("Simple Vote Revealer", string.format("%s voted %s", playerName:upper(), vote:upper()))
local selectedStyle = { "YES", "NO"}
if menuCombo:GetInt() == 1 then
selectedStyle = { "1", "0" }
end
print(menuCombo:GetInt())
print(selectedStyle[0])
if vote == 0 then
PrintInChat('\x01[\x0CNEVERLOSE\x01] \x07'..player:GetName()..' \x01voted \x01[\x04'..selectedStyle[1]..'\x01]')
elseif vote == 1 then
PrintInChat('\x01[\x0CNEVERLOSE\x01] \x07'..player:GetName()..' \x01voted \x01[\x07'..selectedStyle[2]..'\x01]')
else
PrintInChat('\x01[\x0CNEVERLOSE\x01] \x07'..player:GetName()..' \x01voted \x01[\x0Aunknown\x01]')
end
end
end
Cheat.RegisterCallback("events", main)