Advertisement
captmicro

copy sv_allowcslua cvar

Jan 16th, 2013
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. ConVar *allowcslua = g_ICvar->FindVar("sv_allowcslua");
  2. if (allowcslua != 0) { MessageBoxA(0, "Failed to find sv_allowcslua convar!", "g_ICvar", 0); ExitProcess(1); }
  3. char *newallowcsluaname = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16);
  4. strcpy_s(newallowcsluaname, 16, "hk_allowcslua"); //be safe when using string functions!
  5. allowcslua->m_pszName = newallowcsluaname;
  6.  
  7. //create "fake" sv_allowcslua convar
  8. ConVar fakeallowcslua("sv_allowcslua", allowcslua->GetString(), allowcslua->m_nFlags, allowcslua->GetHelpText());
  9.  
  10. //force the real sv_allowcslua
  11. allowcslua->SetValue(1); //force sv_allowcslua
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement