Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CmdNoclip(id)
- {
- g_IsInNoclip[id] = get_user_noclip(id);
- if (get_pcvar_num(pcvar_kz_noclip) == 0)
- {
- client_print(id, print_chat, "[%s] Noclip is not enabled on this server.", PLUGIN_TAG);
- return;
- }
- if (!IsAlive(id) || pev(id, pev_iuser1))
- {
- client_print(id, print_chat, "[%s] You must be alive to use this command.", PLUGIN_TAG);
- return;
- }
- if (g_IsInNoclip[id] == false) // enter noclip
- {
- if (g_RunMode[id] || g_RunModeStarting[id] != MODE_NORMAL)
- {
- client_print(id, print_chat, "[%s] No cheating in a race or a no-reset run!", PLUGIN_TAG);
- return;
- }
- CmdPracticeCp(id); // create a cp to return to when disabling noclip
- g_IsInNoclip[id] = true;
- g_CheatCommandsGuard[id] = 1;
- set_user_noclip(id, 1); //turn on noclip
- set_pev(id, pev_maxspeed, g_NoclipSpeed[id]);
- ResetPlayer(id)
- client_print(id, print_chat, "[%s] Noclip enabled", PLUGIN_TAG);
- return;
- }
- else // exit noclip
- {
- g_IsInNoclip[id] = false;
- g_CheatCommandsGuard[id] = 0;
- set_user_noclip(id, 0); // turn off noclip
- set_pev(id, pev_maxspeed, get_cvar_float("sv_maxspeed"));
- client_print(id, print_chat, "[%s] Noclip disabled", PLUGIN_TAG);
- ResetPlayer(id)
- CmdPracticeTp(id); // return to cp made when entering noclip
- return;
- }
- }
- CmdNoclipSpeed(id, speed)
- {
- new maxspeed = get_pcvar_num(pcvar_kz_noclip_maxspeed);
- if (speed > maxspeed)
- {
- speed = maxspeed;
- }
- else if (speed < 0)
- {
- speed = 1;
- }
- g_NoclipSpeed[id] = speed;
- if (pev(id, pev_iuser1) || g_IsInNoclip[id])
- {
- set_pev(id, pev_maxspeed, speed)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement