Advertisement
Mister_Stefan

Clantag Changer (LWv4)

Sep 27th, 2021
1,144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1. -- you can also place here your clantag
  2. local c_tbl =
  3. {
  4.   [0] = "",
  5.   [1] = "B",
  6.   [2] = "B0",
  7.   [3] = "B0B",
  8.   [4] = "B0BE",
  9.   [5] = "B0BER",
  10.   [6] = "B0BERH",
  11.   [7] = "B0BERH00",
  12.   [8] = "B0BERH00K",
  13. }
  14.  
  15. local ffi = require("ffi")
  16.  
  17. ffi.cdef[[
  18.  typedef int(__fastcall* clantag_t)(const char*, const char*);
  19. ]]
  20.  
  21. local fn_change_clantag
  22. local set_clantag
  23.  
  24. menu.set_bool("Misc.clantag_spammer", false)
  25.  
  26. local function clantag()
  27.   if engine.is_in_game() then
  28.     if (fn_change_clantag == nil) then
  29.         fn_change_clantag = utils.find_signature("engine.dll", "53 56 57 8B DA 8B F9 FF 15")
  30.     end
  31.    
  32.     if ((set_clantag == nil) and (fn_change_clantag ~= nil)) then
  33.         set_clantag =  ffi.cast("clantag_t", fn_change_clantag)
  34.     end
  35.    
  36.     local lc_player = entitylist.get_local_player()
  37.     local tickbase = lc_player:get_prop_int("CBasePlayer", "m_nTickBase")
  38.     local server_time = tickbase * globals.get_intervalpertick() * 2.4
  39.    
  40.     local choke = cmd.get_choke()
  41.     local gcase = math.fmod(server_time,16)
  42.     local wcase = gcase
  43.    
  44.     -- reverse our clantag
  45.     if (wcase > 8) then
  46.         wcase = 8 - (gcase - 8)
  47.     end
  48.    
  49.     -- we need int
  50.     wcase = math.floor(wcase + 0.5)
  51.     local ctag = c_tbl[wcase]
  52.    
  53.     if (choke == 0) then
  54.         set_clantag(ctag, ctag)
  55.     end
  56.   end
  57. end
  58.  
  59. client.add_callback("on_createmove", clantag)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement