Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.16 KB | None | 0 0
  1. 1) pridas 2 cvary pod nazvem 'custom_fov' a 'fov_zoom'
  2. 2) usermsg.cpp
  3. pridas toto:
  4.  
  5. ////////////////////
  6. Do funkce SetFOV:
  7.  
  8. BEGIN_READ(pbuf, iSize);
  9.     int iFOV = READ_BYTE();
  10.     g_Local.iFOV = iFOV;
  11.  
  12.     if (iFOV == 90)
  13.     {
  14.         g_Local.bScoped = false;
  15.     }
  16.     else if (iFOV > 0)
  17.     {
  18.         g_Local.bScoped = true;
  19.     }
  20.     if (cvar.custom_fov > 0 && !g_Local.bScoped)
  21.     {
  22.         iFOV = cvar.custom_fov;
  23.         return (*pSetFOV)(pszName, iSize, &iFOV);
  24.     }
  25.     else
  26.     {
  27.         iFOV = 90;
  28.  
  29.         return (*pSetFOV)(pszName, iSize, &iFOV);
  30.     }
  31.  
  32.     return (*pSetFOV)(pszName, iSize, pbuf);
  33.    
  34. A pridas novou funkci pod to
  35.  
  36. void CustomFOV()
  37. {
  38.     static int fov; fov = 90;
  39.     static int fov_old;
  40.  
  41.     if (cvar.custom_fov != 90 && !g_Local.bScoped)
  42.     {
  43.         fov = cvar.custom_fov;
  44.     }
  45.     else if (!g_Local.bScoped)
  46.     {
  47.         fov = cvar.fov_zoom;
  48.     }
  49.     (*pSetFOV)("SetFOV", 1, &fov);
  50.  
  51.  
  52.     fov_old = fov;
  53.  
  54. }
  55.  
  56. ////////////////////
  57.  
  58. 3) do Usermsg.h
  59. pridas toto:
  60.  
  61. ////////////////////
  62.  
  63. extern void CustomFOV();
  64.  
  65. ////////////////////
  66.  
  67. 4) a pak zavolas funkci CustomFOV ve cl_createmove.
  68.  
  69. client.cpp
  70. ve funknci cl_createmove
  71.  
  72. ////////////////////
  73.  
  74. CustomFOV();
  75.  
  76. ////////////////////
  77.  
  78. to je vse
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement