Raised This Month: $32 Target: $400
 8% 

Preventing Pause in Air for ProKreedz


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaNaReaver
Member
Join Date: Apr 2020
Location: India
Old 08-12-2020 , 03:36   Preventing Pause in Air for ProKreedz
Reply With Quote #1

Hey AM,

There are certain KZ maps that require you to fall from a certain height and perform bugs (jumpbug, edgebug, wallbug, etc), and people can pause their timer in air to reduce fall damage, thus allowing them to cross the map without doing any work.

Are there ways to allow the previous fall velocity to be added to the player on unpausing, or preventing pausing in air? I'm worried that the latter cannot be achieved because that would affect hook and noclip usage as well, but I'd like to know what you think.

Going through the ProKreedz 2.31's thread, I read that the Pause in Air was implemented after v2.3, so I found a snippet to prevent pausing in air, but I don't have a great idea as to how and where it should be placed to make it functional. The code snippet is showcased below:

Code:
public Pause(id) {
    if (get_pcvar_num(kz_pause) == 0) {
        kz_hud_message(id, "Pause is disabled")
        return PLUGIN_HANDLED
    }

    if (!timer_started[id]) {
        kz_hud_message(id, "Timer is not started")
        return PLUGIN_HANDLED
    }

    if (!is_user_alive(id)) {
        kz_hud_message(id, "You must be alive to use this command")
        return PLUGIN_HANDLED
    }


    if ((pev(id, pev_flags) & FL_ONGROUND2)) {
        if (!IsPaused[id]) {
            g_pausetime[id] = get_gametime() - timer_time[id]
            timer_time[id] = 0.0
            IsPaused[id] = true
            kz_hud_message(id, "Your timer has been paused")
            set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)
            pev(id, pev_origin, PauseOrigin[id])
        } else {
            timer_time[id] = get_gametime() - g_pausetime[id] + timer_time[id]
            IsPaused[id] = false
            kz_hud_message(id, "Your timer has been unpaused")
            set_pev(id, pev_flags, pev(id, pev_flags) & ~FL_FROZEN)
        }
    } else
        kz_hud_message(id, "You must be on ground to get paused")

    return PLUGIN_HANDLED
}
__________________
MaNaReaver is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode