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

Help / Support [HELP] Shortly Colour-Screenflash by getting a Ammopack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
markusNewRecordzZ
Member
Join Date: Apr 2011
Location: Paderborn, GERMANY
Old 09-05-2011 , 12:35   [HELP] Shortly Colour-Screenflash by getting a Ammopack
Reply With Quote #1

[Help] I search a Plugin for the Humans!

If the Humans get 1 Ammopack (from the shooting-damage) your Screenflash will give shortly a Colour like Green or Blue...

I was searching for this Plugin but I didn't find it...

I hope you know more than me & will help me.

Best Greetings,
your Markus
markusNewRecordzZ is offline
Send a message via Skype™ to markusNewRecordzZ
markusNewRecordzZ
Member
Join Date: Apr 2011
Location: Paderborn, GERMANY
Old 09-06-2011 , 16:07   Re: [HELP] Shortly Colour-Screenflash by getting a Ammopack
Reply With Quote #2

nobody has a Idea... ???
markusNewRecordzZ is offline
Send a message via Skype™ to markusNewRecordzZ
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 09-13-2011 , 08:51   Re: [HELP] Shortly Colour-Screenflash by getting a Ammopack
Reply With Quote #3

find this

PHP Code:
                g_ammopacks[attacker]++
                
g_damagedealt[attacker] -= get_pcvar_num(cvar_ammodamage
and change it to

PHP Code:
                g_ammopacks[attacker]++
                
g_damagedealt[attacker] -= get_pcvar_num(cvar_ammodamage)
                
set_hudmessage(1602112540.670.5110.00.10.21.0, -1)
                
ShowSyncHudMsg(attackerg_MsgSync"+1 AmmoPack"
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
markusNewRecordzZ
Member
Join Date: Apr 2011
Location: Paderborn, GERMANY
Old 09-13-2011 , 16:24   Re: [HELP] Shortly Colour-Screenflash by getting a Ammopack
Reply With Quote #4

@JoKeR LauGh

thanks for your support.

It works fine but it's not exactly what I want.

I want that the full Screen will give a colour if you get 1 AmmoPack and not a Hud-Message.
markusNewRecordzZ is offline
Send a message via Skype™ to markusNewRecordzZ
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 09-14-2011 , 06:06   Re: [HELP] Shortly Colour-Screenflash by getting a Ammopack
Reply With Quote #5

@Markus
sorry , but I don't know how to add a glow screen ( maybe it should be a shaking screen? )
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
markusNewRecordzZ
Member
Join Date: Apr 2011
Location: Paderborn, GERMANY
Old 09-14-2011 , 12:59   Re: [HELP] Shortly Colour-Screenflash by getting a Ammopack
Reply With Quote #6

@Joker LauGh

I mean this Plugin if you get 1 Ammopack:


#include <amxmodx>
#include <amxmisc>


#define FFADE_IN 0x0000 // Just here so we don't pass 0 into the function
#define FFADE_OUT 0x0001 // Fade out (not in)
#define FFADE_MODULATE 0x0002 // Modulate (don't blend)
#define FFADE_STAYOUT 0x0004 // ignores the duration, stays faded out until new ScreenFade message received

enum
{
Red,
Green,
Blue
};


new fadetime

new FADE_STR[3]
new fade_colors
enum
{
R,
G,
B
}
public plugin_init()
{
register_plugin("Kill Fade", "0.1", "Dr.One")
register_event("DeathMsg","EventDeathMsg","a" )
fadetime = register_cvar("amx_fadetime","0.1")
fade_colors = register_cvar("amx_fadecolors","0 0 180")

new fadecolors[16], fade_r[4], fade_g[4], fade_b[4]
get_pcvar_string(fade_colors,fadecolors,sizeo f fadecolors -1)
parse(fadecolors, fade_r, 3,fade_g, 3,fade_b, 3)
FADE_STR[R] = str_to_num(fade_r)
FADE_STR[G] = str_to_num(fade_g)
FADE_STR[B] = str_to_num(fade_b)
}
public EventDeathMsg()
{
new iKiller = read_data( 1 )

if(is_user_alive(iKiller))
{
UTIL_ScreenFade(iKiller,FADE_STR,1.0,get_pcva r_float(fadetime),80);
}

}
stock FixedUnsigned16(Float:flValue, iScale)
{
new iOutput;

iOutput = floatround(flValue * iScale);

if ( iOutput < 0 )
iOutput = 0;

if ( iOutput > 0xFFFF )
iOutput = 0xFFFF;

return iOutput;
}

stock UTIL_ScreenFade(id=0,iColor[3]={0,0,0},Float:flFxTime=-1.0,Float:flHoldTime=0.0,iAlpha=0,iFlags=FFAD E_IN,bool:bReliable=false,bool:bExternal=fals e)
{
if( id && !is_user_connected(id))
return;

new iFadeTime;
if( flFxTime == -1.0 )
{
iFadeTime = 4;
}
else
{
iFadeTime = FixedUnsigned16( flFxTime , 1<<12 );
}

static gmsgScreenFade;
if( !gmsgScreenFade )
{
gmsgScreenFade = get_user_msgid("ScreenFade");
}

new MSG_DEST;
if( bReliable )
{
MSG_DEST = id ? MSG_ONE : MSG_ALL;
}
else
{
MSG_DEST = id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST;
}

if( bExternal )
{
emessage_begin( MSG_DEST, gmsgScreenFade, _, id );
ewrite_short( iFadeTime );
ewrite_short( FixedUnsigned16( flHoldTime , 1<<12 ) );
ewrite_short( iFlags );
ewrite_byte( iColor[Red] );
ewrite_byte( iColor[Green] );
ewrite_byte( iColor[Blue] );
ewrite_byte( iAlpha );
emessage_end();
}
else
{
message_begin( MSG_DEST, gmsgScreenFade, _, id );
write_short( iFadeTime );
write_short( FixedUnsigned16( flHoldTime , 1<<12 ) );
write_short( iFlags );
write_byte( iColor[Red] );
write_byte( iColor[Green] );
write_byte( iColor[Blue] );
write_byte( iAlpha );
message_end();
}
}

stock UTIL_FadeToBlack(id,Float:fxtime=3.0,bool:bRe liable=false,bool:bExternal=false)
{
UTIL_ScreenFade(id, _, fxtime, fxtime, 255, FFADE_OUT|FFADE_STAYOUT,bReliable,bExternal);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1031\\ f0\\ fs16 \n\\ par }
*/

------- Can you help me please ??? -------
markusNewRecordzZ is offline
Send a message via Skype™ to markusNewRecordzZ
MiCHAEL JAi WHiTE
Junior Member
Join Date: Sep 2011
Location: Germany, Paderborn
Old 09-15-2011 , 08:39   Re: [HELP] Shortly Colour-Screenflash by getting a Ammopack
Reply With Quote #7

this Plugin looks good . . .

hope somebody can do it
MiCHAEL JAi WHiTE is offline
Send a message via ICQ to MiCHAEL JAi WHiTE Send a message via MSN to MiCHAEL JAi WHiTE Send a message via Skype™ to MiCHAEL JAi WHiTE
artos
Senior Member
Join Date: Mar 2010
Old 09-18-2011 , 16:29   Re: [HELP] Shortly Colour-Screenflash by getting a Ammopack
Reply With Quote #8

This should work, but you must replace original zp_ammopacks.amxx with this because it's hard coded. I wanted to do it in other way but there's no native for checking if we are currently getting AP+ or AP-. I made an easy stock for you to edit color and density of screenfade, just find make_screenfade(id, 0, 0, 150, 30) and change to everything you want.
Quote:
make_screenfade(id, red, green, blue, density)
PHP Code:
/*================================================================================
    
    -----------------------
    -*- [ZP] Ammo Packs -*-
    -----------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <zp50_core>

#define is_user_valid(%1) (1 <= %1 <= g_MaxPlayers)

#define TASK_HIDEMONEY 100
#define ID_HIDEMONEY (taskid - TASK_HIDEMONEY)

// CS Player PData Offsets (win32)
const PDATA_SAFE 2
const OFFSET_CSMONEY 115

const HIDE_MONEY_BIT = (1<<5)

#define MAXPLAYERS 32

new g_MaxPlayers
new g_MsgHideWeapong_MsgCrosshair
new g_AmmoPacks[MAXPLAYERS+1]

new 
cvar_starting_ammo_packscvar_disable_money

new g_msgScreenFade;

public 
plugin_init()
{
    
register_plugin("[ZP] Ammo Packs""5.0.1""ZP Dev Team")
    
    
g_MaxPlayers get_maxplayers()
    
g_MsgHideWeapon get_user_msgid("HideWeapon")
    
g_MsgCrosshair get_user_msgid("Crosshair")
    
    
cvar_starting_ammo_packs register_cvar("zp_starting_ammo_packs""5")
    
cvar_disable_money register_cvar("zp_disable_money""0")
    
    
g_msgScreenFade get_user_msgid("ScreenFade")
    
    
register_event("ResetHUD""event_reset_hud""be")
    
register_message(get_user_msgid("Money"), "message_money")
}

public 
plugin_natives()
{
    
register_library("zp50_ammopacks")
    
register_native("zp_ammopacks_get""native_ammopacks_get")
    
register_native("zp_ammopacks_set""native_ammopacks_set")
}

public 
native_ammopacks_get(plugin_id)
{
    new 
id get_param(1)
    
    if (!
is_user_valid(id))
    {
        
log_error(AMX_ERR_NATIVE"[ZP] Invalid Player (%d)"id)
        return -
1;
    }
    
    return 
g_AmmoPacks[id];
}

public 
native_ammopacks_set(plugin_idnum_params)
{
    new 
id get_param(1)
    
    if (!
is_user_valid(id))
    {
        
log_error(AMX_ERR_NATIVE"[ZP] Invalid Player (%d)"id)
        return 
false;
    }
    
    new 
amount get_param(2)
    
    if (
amount native_ammopacks_get(id))
        
make_screenfade(id0015030)
    
    
g_AmmoPacks[id] = amount
    
return true;
}

public 
client_putinserver(id)
{
    
g_AmmoPacks[id] = get_pcvar_num(cvar_starting_ammo_packs)
}

public 
client_disconnect(id)
{
    
remove_task(id+TASK_HIDEMONEY)
}

public 
event_reset_hud(id)
{
    
// Hide money?
    
if (get_pcvar_num(cvar_disable_money))
        
set_task(0.1"task_hide_money"id+TASK_HIDEMONEY)
}

// Hide Player's Money Task
public task_hide_money(taskid)
{
    
// Hide money
    
message_begin(MSG_ONEg_MsgHideWeapon_ID_HIDEMONEY)
    
write_byte(HIDE_MONEY_BIT// what to hide bitsum
    
message_end()
    
    
// Hide the HL crosshair that's drawn
    
message_begin(MSG_ONEg_MsgCrosshair_ID_HIDEMONEY)
    
write_byte(0// toggle
    
message_end()
}

public 
message_money(msg_idmsg_destmsg_entity)
{
    
// Disable money setting enabled?
    
if (!get_pcvar_num(cvar_disable_money))
        return 
PLUGIN_CONTINUE;
    
    
fm_cs_set_user_money(msg_entity0)
    return 
PLUGIN_HANDLED;
}

// Set User Money
stock fm_cs_set_user_money(idvalue)
{
    
// Prevent server crash if entity's private data not initalized
    
if (pev_valid(id) != PDATA_SAFE)
        return;
    
    
set_pdata_int(idOFFSET_CSMONEYvalue)
}

stock make_screenfade(idredgreenbluedensity)
{
    
message_begin(MSG_ONEg_msgScreenFade_id)
    
write_short(1<<12// duration
    
write_short(0// hold time
    
write_short(0x0000// fade type
    
write_byte(red// red
    
write_byte(green// green
    
write_byte(blue// blue
    
write_byte(density// alpha
    
message_end()

__________________
artos is offline
Send a message via Skype™ to artos
MiCHAEL JAi WHiTE
Junior Member
Join Date: Sep 2011
Location: Germany, Paderborn
Old 09-19-2011 , 16:06   Re: [HELP] Shortly Colour-Screenflash by getting a Ammopack
Reply With Quote #9

Quote:
This should work, but you must replace original zp_ammopacks.amxx with this because it's hard coded. I wanted to do it in other way but there's no native for checking if we are currently getting AP+ or AP-. I made an easy stock for you to edit color and density of screenfade, just find make_screenfade(id, 0, 0, 150, 30) and change to everything you want.
Error. Can not read from file "zp50_core"
__________________

ViSiT MY HÒMÈPÀGÈ HÈRÈ + ÀLSÒ RÈGiÈSTÈR YÒU iN...

www.Love-Gamers.tk

***** THÀNKS FÒR YÒUR ViSiT *****
MiCHAEL JAi WHiTE is offline
Send a message via ICQ to MiCHAEL JAi WHiTE Send a message via MSN to MiCHAEL JAi WHiTE Send a message via Skype™ to MiCHAEL JAi WHiTE
artos
Senior Member
Join Date: Mar 2010
Old 09-19-2011 , 16:39   Re: [HELP] Shortly Colour-Screenflash by getting a Ammopack
Reply With Quote #10

Quote:
Originally Posted by MiCHAEL JAi WHiTE View Post
Error. Can not read from file "zp50_core"
You need Zombie Plague 5.0+ include files to get this work.
__________________
artos is offline
Send a message via Skype™ to artos
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 05:47.


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