AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] Plugin (https://forums.alliedmods.net/showthread.php?t=244029)

frOOgy 07-12-2014 19:19

[REQ] Plugin
 
Hi all. I need plugin when you kill enemy then you can see low blue screen at ¼ of Second. THX!

Alphad 07-15-2014 02:56

Re: [REQ] Plugin
 
PHP Code:

#include <amxmodx>
#include <fun>

#define PLUGIN_VERSION "1.0"

new g_Killer

public plugin_init()
{
   
register_plugin("Screen Fade"PLUGIN_VERSION"zEEDu")

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

public 
hook_death()
{
   
g_Killer read_data(1)

   if(
is_user_alive(g_Killer))
   {
   
message_begin(MSG_ONEget_user_msgid("ScreenFade"), {0,0,0}, g_Killer)
   
write_short(1<<10)
   
write_short(1<<10)
   
write_short(0x0000)
   
write_byte(30)
   
write_byte(144)
   
write_byte(255)
   
write_byte(75)
   
message_end()
   }
   



HamletEagle 07-15-2014 04:37

Re: [REQ] Plugin
 
PHP Code:

#include <amxmodx> 
#include <fun> 

#define PLUGIN_VERSION "1.0" 

new g_Killer 
new gmsgFade

public plugin_init() 

    
register_plugin("Screen Fade"PLUGIN_VERSION"zEEDu"

    
register_event("DeathMsg""hook_death""a""1>0"

    
gmsgFade get_user_msgid("ScreenFade")



public 
hook_death() 

    
g_Killer read_data 

    if(
is_user_alive(g_Killer) ) 
    { 
        
message_begin(MSG_ONEgmsgFade,g_Killer 
        
write_short(1<<10
        
write_short(1<<10
        
write_short(0x0000
        
write_byte(30
        
write_byte(144
        
write_byte(255
        
write_byte(75
        
message_end() 
    } 
    


Optimized and indented the code a bit. I would suggest you to don't write directly the bits, use "normal" values, that users can edit it very easy. In order to do this, use this UTIL
PHP Code:


UTIL_FixedUnsigned16 
( const Float:Value, const Scale ) {
    
    new 
output floatroundValue Scale )
    return 
clampoutput00xFFFF )
    




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

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