Raised This Month: $ Target: $400
 0% 

[ReQ] Feign Death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
frank_freeman
Member
Join Date: Nov 2012
Old 11-04-2012 , 04:59   [ReQ] Feign Death
Reply With Quote #1

Could someone please write a feign death plugin for HLDM (related mods)?
I would surely love him to death!
frank_freeman is offline
frank_freeman
Member
Join Date: Nov 2012
Old 12-02-2012 , 12:09   Re: [ReQ] Feign Death
Reply With Quote #2

Didn't lose hope yet
frank_freeman is offline
frank_freeman
Member
Join Date: Nov 2012
Old 01-02-2013 , 15:37   Re: [ReQ] Feign Death
Reply With Quote #3

You know like in TFC or the suprise mod ...
frank_freeman is offline
Old 01-02-2013, 16:33
kNowo
This message has been deleted by kNowo. Reason: this should be a pm
frank_freeman
Member
Join Date: Nov 2012
Old 08-06-2013 , 09:01   Re: [ReQ] Feign Death
Reply With Quote #4

anyone?
frank_freeman is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 08-10-2013 , 06:40   Re: [ReQ] Feign Death
Reply With Quote #5

Fake Death
PHP Code:
/****************************************************************************************************

            Fake Death
                - Shooting King

        1. Cvars:
                1. amx_sk_fdeath_cost - Cost of Fake Death. Default: 2000 
                2. amx_sk_fdeath_corpsestay - Corpse Stay Time ( If you keep long 
                   time it may cause lag ). Default: 15
                3. amx_sk_fdeath_invistime - Invisibility time. Default: 10
                4. amx_sk_fdeath_auto - Automatically use Fake Death, when he has 
                   bought it, and when attacked by an enemy. Default: 1
        
        2. Cmds:
                1. say /buyfdeath - Buy Fake Death.
                2. say_team /buyfdeath - Buy Fake Death.
                3. say /fdeath - Execute fake death.
                4. say_team /fdeath - Execute fake death.

***************************************************************************************************/


#include <amxmodx>
#include <cstrike>
#include <engine>
#include <hamsandwich>

#define PLUGIN        "Fake Death"
#define VERSION        "1.0"
#define AUTHOR        "Shooting King"

#define TASK_HUD    91283

new g_isInFake[33];
new 
g_TimeRemaining[33];
new 
g_FakeDeath[33];

new 
pcvar_cost;
new 
pcvar_cstay;
new 
pcvar_invistime;
new 
pcvar_autofd;

new 
SyncHudObj;

public 
plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR );    
    
register_clcmd"say /fdeath""cmd_FDeath" );    
    
register_clcmd"say /buyfdeath""cmd_BuyFDeath" );
    
register_clcmd"say_team /fdeath""cmd_FDeath" );    
    
register_clcmd"say_team /buyfdeath""cmd_BuyFDeath" );    
        
    
pcvar_cost register_cvar"amx_sk_fdeath_cost""2000" );
    
pcvar_cstay register_cvar"amx_sk_fdeath_corpsestay""15" );
    
pcvar_invistime register_cvar"amx_sk_fdeath_invistime""10" );
    
pcvar_autofd register_cvar"amx_sk_fdeath_auto""1" );
    
    
register_event"HLTV""Event_RoundStart""a""1=0""2=0" );
    
RegisterHamHam_TakeDamage"player""Event_TakeDamage"false);

    
SyncHudObj CreateHudSyncObj();
}

public 
Event_RoundStart()
{
    
Remove_Entities();

    for( new 
133i++ )
    {
        if( 
g_isInFake[i] )
        {
            
Remove_Invisibility(i);
        }
        
        if(
task_exists(TASK_HUD+i))
        {
            
remove_task(TASK_HUD+i);
            
g_TimeRemaining[i] = 0;
        }
    }

}

public 
Event_TakeDamageidiInflictoriAttackerFloat:flDamagebitsDamageType )
{    
    new 
szWeapon[32];
    if((
get_user_team(iAttacker) != get_user_team(id)) 
        && 
is_player(iAttacker
        && (
flDamage >= get_user_health(id)) 
        && 
get_pcvar_num(pcvar_autofd)
        && (
g_FakeDeath[id] > 0)
        && !
g_isInFake[id])
    {
        
Fake_Death(id);

        
get_weaponnameget_user_weapon(iAttacker), szWeaponcharsmax(szWeapon));
        
replaceszWeapon32"weapon_""" ); 
        
DeathMsgiAttackeridszWeapon);        
        
        return 
HAM_SUPERCEDE;
    }    
    return 
HAM_IGNORED;
}

public 
client_putinserver(id)
{
    
g_isInFake[id] = 0;
    
g_TimeRemaining[id] = 0;
    
g_FakeDeath[id] = 0;
    if(
task_exists(TASK_HUD+id))
    {
        
remove_task(TASK_HUD+id);
    }
}

public 
cmd_BuyFDeath(id)
{
    new 
iMoneyiCost;
    
iMoney cs_get_user_money(id);
    
iCost get_pcvar_numpcvar_cost );

    if( 
iMoney >= iCost )
    {
        
g_FakeDeath[id]++;
        
cs_set_user_moneyidiMoney-iCost); 
        
client_printidprint_chat"You have bought Fake Death." );
    }
    else
    {
        
client_printidprint_chat"You dont have %d$."iCost );
    }
}

public 
cmd_FDeath(id)
{
    
Fake_Death(id);
}

public 
Fake_Death(id)
{
    if( 
g_isInFake[id] )
    {
        
client_printidprint_chat"You have to wait %d Seconds."g_TimeRemaining[id] );
        return 
PLUGIN_CONTINUE;
    }
    
    if( 
g_FakeDeath[id] < )
    {
        
client_printidprint_chat"You dont have Fake Death." );
        return 
PLUGIN_CONTINUE;    
    }
    
    new 
szModel[64], szTempModel[32];
    new 
EntFloat:Origin[3], Float:Angle[3];
    new 
iRand random_num101110 );
    
    new 
Float:Maxs[3] = {16.0,16.0,36.0};
    new 
Float:Mins[3] = {-16.0,-16.0,-36.0};    
    
    
szModel[0] = '^0';
    
cs_get_user_modelidszTempModel31 );
    
formatexszModel63"models/player/%s/%s.mdl"szTempModelszTempModel);
    
entity_get_vectoridEV_VEC_originOrigin);    
    
entity_get_vectoridEV_VEC_v_angleAngle);
    
    
Ent create_entity"info_target" );    
    
entity_set_stringEntEV_SZ_classname,"Ent_FDeath");

    
entity_set_modelEntszModel);
    
entity_set_stringEntEV_SZ_modelszModel); 
        
    
entity_set_intEntEV_INT_movetypeMOVETYPE_FLY);
    
entity_set_floatEntEV_FL_animtime2.0);
    
entity_set_floatEntEV_FL_framerate1.0);
    
entity_set_intEntEV_INT_sequenceiRand);
    
entity_set_sizeEntMinsMaxs);
    
entity_set_intEntEV_INT_solidSOLID_BBOX);
    
entity_set_vectorEntEV_VEC_v_angleAngle);
    
entity_set_edictEntEV_ENT_ownerid);
    
    
entity_set_originEntOrigin);
    
drop_to_floorEnt );
        
    
set_renderingidkRenderFxNone0,0,0kRenderTransAdd1);
        
    
set_taskget_pcvar_float(pcvar_invistime), "Remove_Invisibility"id);
    
set_taskget_pcvar_float(pcvar_cstay), "Remove_Ent"Ent);
    
    
g_isInFake[id] = 1;
    
g_TimeRemaining[id] = get_pcvar_numpcvar_invistime );
    
g_FakeDeath[id]--;
    
client_printidprint_chat"You have %d Fake Death remaining..."g_FakeDeath[id]); 
    
    
ShowHUDTime(id+TASK_HUD);    
    return 
PLUGIN_HANDLED;
}

public 
ShowHUDTime(id)
{
    
id -= TASK_HUD;
    if( 
g_TimeRemaining[id] > )
    {
        
set_hudmessage02500.950.6506.02.00.20.3);
        
ShowSyncHudMsgidSyncHudObj"%d Seconds Remaining..."g_TimeRemaining[id]);
        
g_TimeRemaining[id]--;
        
set_task1.0"ShowHUDTime"TASK_HUD+id);
    }
    else
    {
        
set_hudmessage25000.950.6516.03.00.20.3);
        
ShowSyncHudMsgidSyncHudObj"You are visible Now." );
    }
}

public 
Remove_Invisibility(id)
{
    
set_renderingidkRenderFxNone0,0,0kRenderNormal0);
    
FixAttrib(id);
    
g_isInFake[id] = 0;        
}
    
public 
Remove_Ent(Ent)
{
    
remove_entity(Ent);
}

stock Remove_Entities()
{
    new 
temp_ent find_ent_by_class(temp_ent"Ent_FDeath");

    while( 
temp_ent 0
    {
        
remove_entity(temp_ent);
        
temp_ent find_ent_by_class(temp_ent"Ent_FDeath");
    }
}

stock is_player(id)
{
    if( 
<= id <= get_maxplayers())
    {
        return 
1;
    }
    return 
0;
}

stock DeathMsg(iKilleriVictim, const szWeapon[])
{
    
message_begin(MSG_BROADCASTget_user_msgid("DeathMsg")); 
    
write_byte(iKiller);
    
write_byte(iVictim);
    
write_byte(0);
    
write_string(szWeapon);
    
message_end();
}

stock FixAttrib(id)
{
    
message_begin(MSG_BROADCASTget_user_msgid("ScoreAttrib"));
    
write_byte(id);
    
write_byte(0); 
    
message_end();

Cvars:

1. amx_sk_fdeath_cost - Cost of Fake Death. Default: 2000
2. amx_sk_fdeath_corpsestay - Corpse Stay Time ( If you keep long time it may cause lag ) . Default: 15
3. amx_sk_fdeath_invistime - Invisibility time. Default: 10
4. amx_sk_fdeath_auto - Automatically use Fake Death, when he has bought it, and when attacked by an enemy. Default: 1

Cmds:

1. say /buyfdeath - Buy Fake Death.
2. say_team /buyfdeath - Buy Fake Death.
3. say /fdeath - Execute fake death.
4. say_team /fdeath - Execute fake death.

Note:

Make sure that all player models are the below format
CsDir/models/player/<Name>/<Name>.mdl
Attached Files
File Type: sma Get Plugin or Get Source (fake_death.sma - 681 views - 6.4 KB)
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here

Last edited by Shooting King; 08-10-2013 at 12:31.
Shooting King is offline
frank_freeman
Member
Join Date: Nov 2012
Old 08-12-2013 , 06:43   Re: [ReQ] Feign Death
Reply With Quote #6

So swtiching back from PMs to the thread

Unfortunately my serverlog says, I need the cstrike module.
But I don't have/use it.
Is it possible to use the plugin without the cstrike module for HLDM and related mods?
frank_freeman 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 14:25.


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