Advertisement
Guest User

Untitled

a guest
Sep 30th, 2022
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.61 KB | Source Code | 0 0
  1. CmdNoclip(id)
  2.  {
  3.     g_IsInNoclip[id] = get_user_noclip(id);
  4.    
  5.     if (get_pcvar_num(pcvar_kz_noclip) == 0)
  6.     {
  7.         client_print(id, print_chat, "[%s] Noclip is not enabled on this server.", PLUGIN_TAG);
  8.         return;
  9.     }
  10.     if (!IsAlive(id) || pev(id, pev_iuser1))
  11.     {
  12.         client_print(id, print_chat, "[%s] You must be alive to use this command.", PLUGIN_TAG);
  13.         return;
  14.     }
  15.    
  16.     if (g_IsInNoclip[id] == false)           // enter noclip
  17.     {  
  18.         if (g_RunMode[id] || g_RunModeStarting[id] != MODE_NORMAL)
  19.         {
  20.             client_print(id, print_chat, "[%s] No cheating in a race or a no-reset run!", PLUGIN_TAG);
  21.             return;
  22.         }
  23.         CmdPracticeCp(id);                  // create a cp to return to when disabling noclip
  24.         g_IsInNoclip[id] = true;
  25.         g_CheatCommandsGuard[id] = 1;              
  26.         set_user_noclip(id, 1);             //turn on noclip
  27.         set_pev(id, pev_maxspeed, g_NoclipSpeed[id]);
  28.         ResetPlayer(id)
  29.         client_print(id, print_chat, "[%s] Noclip enabled", PLUGIN_TAG);
  30.         return;
  31.     }
  32.     else                                    // exit noclip
  33.     {  
  34.         g_IsInNoclip[id] = false;
  35.         g_CheatCommandsGuard[id] = 0;
  36.         set_user_noclip(id, 0);             // turn off noclip
  37.         set_pev(id, pev_maxspeed, get_cvar_float("sv_maxspeed"));
  38.         client_print(id, print_chat, "[%s] Noclip disabled", PLUGIN_TAG);
  39.         ResetPlayer(id)
  40.         CmdPracticeTp(id);                  // return to cp made when entering noclip
  41.         return;
  42.     }
  43. }
  44.  
  45. CmdNoclipSpeed(id, speed)
  46. {
  47.     new maxspeed = get_pcvar_num(pcvar_kz_noclip_maxspeed);
  48.     if (speed > maxspeed)
  49.     {
  50.         speed = maxspeed;
  51.     }
  52.     else if (speed < 0)
  53.     {
  54.         speed = 1;
  55.     }
  56.    
  57.     g_NoclipSpeed[id] = speed;
  58.    
  59.     if (pev(id, pev_iuser1) || g_IsInNoclip[id])
  60.     {
  61.         set_pev(id, pev_maxspeed, speed)
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement