Skip to content
View in the app

A better way to browse. Learn more.

Learn more

readable-message-hold/addons/amxmodx/scripting/include/olds_readtime.inc

olds_readtime.inc
73 lines · 2.4 KB · Pawn include
Raw
/*
 * Readable Message Hold (olds_readtime) - natives for other plugins.
 * olds.ro workshop card IDEA-3626EAE5A4C5A12F.
 *
 * Copy this file to addons/amxmodx/scripting/include/ and add
 *     #include <olds_readtime>
 * to a plugin. olds_readtime.amxx must be running, or the plugin will not
 * load (see the note at the end for an optional use).
 *
 * Copyright (C) 2026 alexit (olds.ro workshop)
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#if defined _olds_readtime_included
	#endinput
#endif
#define _olds_readtime_included

#pragma reqlib olds_readtime
#if !defined AMXMODX_NOAUTOLOAD
	#pragma loadlib olds_readtime
#endif

/**
 * The player's message hold multiplier: 1.0, 1.5, 2.0 ... It is 1.0 while
 * olds_readtime_enable is 0, and never above olds_readtime_max.
 *
 * @param id    Player index (1 - 32)
 *
 * @return      The multiplier; 1.0 for an invalid index
 */
native Float:olds_readtime_get(id);

/**
 * Shows a HUD message that stays on screen for holdtime times the player's
 * multiplier. Same as set_hudmessage(r, g, b, x, y, 0, 6.0, hold, 0.1, 0.2, -1)
 * followed by show_hudmessage(id, "%s", text).
 *
 * @param id        Player index, or 0 for every player (each with their own
 *                  hold time)
 * @param r         Red (0 - 255)
 * @param g         Green (0 - 255)
 * @param b         Blue (0 - 255)
 * @param x         X position, -1.0 = centre
 * @param y         Y position, -1.0 = centre
 * @param holdtime  Normal time on screen in seconds, for players on 1x
 * @param text      The message (not a format string)
 *
 * @return          Number of players the message was shown to
 */
native olds_hud_show(id, r, g, b, Float:x, Float:y, Float:holdtime, const text[]);

/*
 * Optional use: a plugin that should also work without olds_readtime can
 * mark the library as optional and fall back to the normal functions:
 *
 *     #define AMXMODX_NOAUTOLOAD
 *     #include <olds_readtime>
 *
 *     public plugin_natives()
 *     {
 *         set_module_filter("module_filter");
 *         set_native_filter("native_filter");
 *     }
 *
 *     public module_filter(const library[], LibType:type)
 *         return equal(library, "olds_readtime") ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
 *
 *     public native_filter(const name[], index, trap)
 *         return trap ? PLUGIN_CONTINUE : PLUGIN_HANDLED;
 *
 * and before each call check LibraryExists("olds_readtime", LibType_Library).
 */

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.