Raised This Month: $ Target: $400
 0% 

how to remove the sprities from the map?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
VEN
Veteran Member
Join Date: Jan 2005
Old 04-19-2007 , 07:00   Re: how to remove the sprities from the map?
Reply With Quote #10

Code:
/* AMX Mod X *   Hide Radar, Health, Armor * * (c) Copyright 2007 by VEN * * This file is provided as is (no warranties) * *       NOTE *               This plugin was written in especial manner in try to be "friendly" to other plugins. *               HideWeapon message non-conflict scripting quite problematic for a number of reasons. */ #include <amxmodx> #include <amxmisc> #include <fakemeta> // comment to not hide radar, health, armor for all clients by default #define HIDE_HEALTH_ARMOR_RADAR_FOR_ALL // amx_hideradar command access level #define COMMAND_ACCESS ADMIN_SLAY // comment to make amx_hideradar command to not obey immunity #define OBEY_IMMUNITY // symbol + mean that additional small crosshair will be drawn #define HIDEHUD_CROSSHAIR_AMMO_WEAPLIST (1<<0) // a #define HIDEHUD_FLASHLIGHT (1<<1)              // b + #define HIDEHUD_ALL (1<<2)                     // c #define HIDEHUD_HEALTH_ARMOR_RADAR (1<<3)      // d + #define HIDEHUD_ROUND_TIMER (1<<4)             // e + #define HIDEHUD_MONEY (1<<5)                   // f + #define HIDEHUD_CROSSHAIR (1<<6)               // g #define HIDEHUD_NONE (1<<7)                    // h + #define HIDE_HUD_ELEMENTS HIDEHUD_HEALTH_ARMOR_RADAR #define MAX_CLIENTS 32 #if defined HIDE_HEALTH_ARMOR_RADAR_FOR_ALL         new g_hide_hud_elements[MAX_CLIENTS + 1] = {HIDE_HUD_ELEMENTS, ...} #else         new g_hide_hud_elements[MAX_CLIENTS + 1] = {0, ...} #endif new g_msgid_resethud new g_msgid_hideweapon new g_msgid_crosshair new bool:g_skip_msg = false new g_hide_hud = 0 new g_hide_crosshair = 0 public plugin_init() {         register_plugin("Hide Radar, Health, Armor", "0.1", "VEN")         g_msgid_resethud = get_user_msgid("ResetHUD")         g_msgid_hideweapon = get_user_msgid("HideWeapon")         g_msgid_crosshair = get_user_msgid("Crosshair")         // some hidden hud elements will be redrawn on HUD reset so we use this         // emessage execution in hook from register_event("XXX", "ev_XXX", "b")         // causing stack error/recursion (core bug?) so we need this workaround         register_forward(FM_MessageBegin, "forward_message_begin", 1)         register_forward(FM_MessageEnd, "forward_message_end", 1) // important: post hook         register_message(g_msgid_hideweapon, "message_hide_weapon")         register_concmd("amx_hideradar", "cmd_hideradar", COMMAND_ACCESS, "<name or #userid> [0|1] - hides/unhides radar, health, armor") } public cmd_hideradar(caller, level, cid) {         if (!cmd_access(caller, level, cid, 2))                 return PLUGIN_HANDLED         static arg[32], id         read_argv(1, arg, sizeof arg - 1) #if defined OBEY_IMMUNITY         id = cmd_target(caller, arg, 1) #else         id = cmd_target(caller, arg, 0) #endif         if (!id)                 return PLUGIN_HANDLED         read_argv(2, arg, 1)         switch (arg[0]) {                 case '1': hide_hud_elements(id, HIDE_HUD_ELEMENTS)                 case '0': hide_hud_elements(id, 0)                 default: console_print(caller, "User's radar, health, armor is %s", g_hide_hud_elements[id] ? "hidden" : "displayed")         }         return PLUGIN_HANDLED }   public forward_message_begin(msg_dest, msg_id, const Float:origin[3], id) {         if (!g_skip_msg && msg_dest == MSG_ONE && g_hide_hud_elements[id]) {                 if (msg_id == g_msgid_resethud)                         g_hide_hud = id                 else if (msg_id == g_msgid_hideweapon)                         g_hide_crosshair = id         }         return FMRES_IGNORED } public forward_message_end() {         if (g_skip_msg)                 return FMRES_IGNORED         static id         if (g_hide_hud) {                 id = g_hide_hud                 g_hide_hud = 0                 if (g_hide_hud_elements[id] && is_user_connected(id))                         hide_hud_elements(id, g_hide_hud_elements[id])         }         else if (g_hide_crosshair) {                 id = g_hide_crosshair                 g_hide_crosshair = 0                 if (g_hide_hud_elements[id] && is_user_connected(id))                         hide_crosshair(id)         }         return FMRES_IGNORED } hide_hud_elements(id, flags) {         g_hide_hud_elements[id] = flags         g_skip_msg = true         emessage_begin(MSG_ONE, g_msgid_hideweapon, _, id)         ewrite_byte(flags)         emessage_end()         hide_crosshair(id)         g_skip_msg = false } public message_hide_weapon(msg_dest, msg_id, id) {         if (g_hide_hud_elements[id]) {                 static arg                 arg = get_msg_arg_int(1)                 if (!(arg & HIDE_HUD_ELEMENTS))                         set_msg_arg_int(1, ARG_BYTE, arg | HIDE_HUD_ELEMENTS)         } } hide_crosshair(id) {         emessage_begin(MSG_ONE, g_msgid_crosshair, _, id)         ewrite_byte(0)         emessage_end() } public client_disconnect(id) {         #if defined HIDE_HEALTH_ARMOR_RADAR_FOR_ALL                 g_hide_hud_elements[id] = HIDE_HUD_ELEMENTS         #else                 g_hide_hud_elements[id] = 0         #endif }
Attached Files
File Type: sma Get Plugin or Get Source (hide_health_armor_radar.sma - 864 views - 4.4 KB)
VEN is offline
 



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 06:35.


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