public event_Damage(id)
{
if(get_pcvar_num(PCVAR_STATUS) <= 0 || !is_user_alive(id) || is_user_bot(id))
return PLUGIN_CONTINUE;
new iWeapID, attacker = get_user_attacker(id, iWeapID);
if(!is_user_connected(attacker))
return PLUGIN_CONTINUE;
if(iWeapID == CSW_KNIFE)
{
new Float:fVec[3];
fVec[0] = random_float(PA_LOW , PA_HIGH);
fVec[1] = random_float(PA_LOW , PA_HIGH);
fVec[2] = random_float(PA_LOW , PA_HIGH);
pev(id, pev_punchangle, fVec);
message_begin(MSG_ONE, gMsgScreenShake, {0,0,0} ,id)
write_short( 1<<14 );
write_short( 1<<14 );
write_short( 1<<14 );
message_end();
message_begin(MSG_ONE_UNRELIABLE, gMsgScreenFade, {0,0,0}, id);
write_short( 1<<10 );
write_short( 1<<10 );
write_short( 1<<12 );
write_byte( 225 );
write_byte( 0 );
write_byte( 0 );
write_byte( 125 );
message_end();
#if defined USE_SOUND
client_cmd(id, "spk ^"%s^"", HE_SOUND);
#endif
}
return PLUGIN_CONTINUE;
}
Co trzeba zmienić w tym kodzie żeby można było podkleić pod klase?
if(get_pcvar_num(PCVAR_STATUS) <= 0 || !is_user_alive(id) || is_user_bot(id))
return PLUGIN_CONTINUE;
I co w tym zmienić
______________
Dam cały plugin
#include <amxmodx>
#include <fakemeta>
#define USE_SOUND // comment this line if you don't wanna use the sound that came with it
#define PA_LOW 25.0
#define PA_HIGH 50.0
new gMsgScreenShake;
new gMsgScreenFade;
new PCVAR_STATUS;
new const CVAR_STATUS[] = "he_damage_effect";
new const HE_SOUND[] = "misc/deaf_sound.wav";
public plugin_init()
{
register_plugin("HE Damage Effect", "1.0", "v3x");
register_event("Damage", "event_Damage", "b", "2>0");
PCVAR_STATUS = register_cvar(CVAR_STATUS, "1");
gMsgScreenShake = get_user_msgid("ScreenShake");
gMsgScreenFade = get_user_msgid("ScreenFade");
}
#if defined USE_SOUND
public plugin_precache()
precache_sound(HE_SOUND);
#endif
public event_Damage(id)
{
if(get_pcvar_num(PCVAR_STATUS) <= 0 || !is_user_alive(id) || is_user_bot(id))
return PLUGIN_CONTINUE;
new iWeapID, attacker = get_user_attacker(id, iWeapID);
if(!is_user_connected(attacker))
return PLUGIN_CONTINUE;
if(iWeapID == CSW_KNIFE)
{
new Float:fVec[3];
fVec[0] = random_float(PA_LOW , PA_HIGH);
fVec[1] = random_float(PA_LOW , PA_HIGH);
fVec[2] = random_float(PA_LOW , PA_HIGH);
pev(id, pev_punchangle, fVec);
message_begin(MSG_ONE, gMsgScreenShake, {0,0,0} ,id)
write_short( 1<<14 );
write_short( 1<<14 );
write_short( 1<<14 );
message_end();
message_begin(MSG_ONE_UNRELIABLE, gMsgScreenFade, {0,0,0}, id);
write_short( 1<<10 );
write_short( 1<<10 );
write_short( 1<<12 );
write_byte( 225 );
write_byte( 0 );
write_byte( 0 );
write_byte( 125 );
message_end();
#if defined USE_SOUND
client_cmd(id, "spk ^"%s^"", HE_SOUND);
#endif
}
return PLUGIN_CONTINUE;
}
Użytkownik Valito edytował ten post 11.04.2010 07:02