Raised This Month: $51 Target: $400
 12% 

Blueflash /fade command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xtheone
Junior Member
Join Date: Sep 2010
Old 03-21-2012 , 09:36   Blueflash /fade command
Reply With Quote #1

Hi, can anybody add a /fade command that shuts on/off the blue fade? Thank you in advance!

Code:
/*
*   http://games.qwerty.ru
*
*    AmxModX
*   Vampire plugin
*    by Shalfey
*
*   CVars
*   amx_vampire_hp - hp add for kill
*   amx_vampire_hp_hs - hp add for kill in head
*   amx_vampire_max_hp - max player hp
*
*   Players gets HP for kills.
*/
#include <amxmodx>
#include <fun>

#define PLUGIN_VERSION "1.0c"

new health_add
new health_hs_add
new health_max

new nKiller
new nKiller_hp
new nHp_add
new nHp_max

public plugin_init()
{
   register_plugin("Vampire", PLUGIN_VERSION, "Shalfey")

   health_add = register_cvar("amx_vampire_hp", "5")
   health_hs_add = register_cvar("amx_vampire_hp_hs", "10")
   health_max = register_cvar("amx_vampire_max_hp", "110")

   register_event("DeathMsg", "hook_death", "a", "1>0")     
}

public hook_death()
{
   // Killer id
   nKiller = read_data(1)

   if ( (read_data(3) == 1) && (read_data(5) == 0) )
   {
      nHp_add = get_pcvar_num (health_hs_add)
   }
   else
      nHp_add = get_pcvar_num (health_add)

   nHp_max = get_pcvar_num (health_max)

   // Updating Killer HP
   nKiller_hp = get_user_health(nKiller)
   nKiller_hp += nHp_add

   // Maximum HP check
   if (nKiller_hp > nHp_max) nKiller_hp = nHp_max

   set_user_health(nKiller, nKiller_hp)

   // Screen fading
   message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
   write_short(1<<10)
   write_short(1<<10)
   write_short(0x0000)
   write_byte(0)
   write_byte(0)
   write_byte(200)
   write_byte(75)
   message_end()
   
}
xtheone is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 03-21-2012 , 10:05   Re: Blueflash /fade command
Reply With Quote #2

Code:
/* *   <a href="http://games.qwerty.ru" target="_blank" rel="nofollow noopener">http://games.qwerty.ru</a> * *   AmxModX *   Vampire plugin *    by Shalfey * *   CVars *   amx_vampire_hp - hp add for kill *   amx_vampire_hp_hs - hp add for kill in head *   amx_vampire_max_hp - max player hp * *   /fade - switch fade screen on or off * *   Players gets HP for kills. */ #include <amxmodx> #include <fun> #define PLUGIN_VERSION "1.0c" new health_add new health_hs_add new health_max new nKiller new nKiller_hp new nHp_add new nHp_max new bool:FadeScreen[33] public plugin_init() {     register_plugin("Vampire", PLUGIN_VERSION, "Shalfey")     health_add = register_cvar("amx_vampire_hp", "10")     health_hs_add = register_cvar("amx_vampire_hp_hs", "15")     health_max = register_cvar("amx_vampire_max_hp", "100")     register_clcmd("say /fade", "CmdSwitch")     register_clcmd("say_team /fade", "CmdSwitch")     register_event("DeathMsg", "hook_death", "a", "1>0")     } public hook_death() {     // Killer id     nKiller = read_data(1)     if ((read_data(3) == 1) && (read_data(5) == 0))     {         nHp_add = get_pcvar_num (health_hs_add)     }     else         nHp_add = get_pcvar_num (health_add)     nHp_max = get_pcvar_num (health_max)     // Updating Killer HP     nKiller_hp = get_user_health(nKiller)     nKiller_hp += nHp_add     // Maximum HP check     if (nKiller_hp > nHp_max) nKiller_hp = nHp_max     set_user_health(nKiller, nKiller_hp)     // Hud message "Healed <..> hp"     set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)     show_hudmessage(nKiller, "Healed +%d hp", nHp_add)     if(is_user_alive(nKiller) && FadeScreen[nKiller])     {         // Screen fading         message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)         write_short(1<<10)         write_short(1<<10)         write_short(0x0000)         write_byte(0)         write_byte(0)         write_byte(200)         write_byte(75)         message_end()     } } public client_connect(id) {     FadeScreen[id] = true } public CmdSwitch(id) {     FadeScreen[id] = FadeScreen[id] ? false : true         client_print(id, print_chat, "Fade Screen: %s", FadeScreen[id] ? "Enabled" : "Disabled")         return PLUGIN_HANDLED }

Last edited by Rirre; 03-21-2012 at 10:39.
Rirre is offline
xtheone
Junior Member
Join Date: Sep 2010
Old 03-21-2012 , 10:25   Re: Blueflash /fade command
Reply With Quote #3

"Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Expected token: "-identifier-", but found "switch" on line 87
Error: Invalid function or declaration on line 91

2 Errors.
Could not locate output file C:\HLServer\cstrike\addons\amxmodx\scripting\ blueflash.amx (compile failed)."
xtheone is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 03-21-2012 , 10:36   Re: Blueflash /fade command
Reply With Quote #4

Edited my first post. Try now.
Rirre is offline
xtheone
Junior Member
Join Date: Sep 2010
Old 03-21-2012 , 11:06   Re: Blueflash /fade command
Reply With Quote #5

It works but when i write /fade it still flashes blue..
xtheone 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 06:19.


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