Raised This Month: $ Target: $400
 0% 

first person view after death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-21-2013 , 17:34   first person view after death
Reply With Quote #1

i need a plugin that will force to have first person view right after death. thanks in advance.
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
djaykuteray
Junior Member
Join Date: Feb 2011
Location: Turkiye
Old 04-21-2013 , 17:42   Re: first person view after death
Reply With Quote #2

Code:
/*    Formatright © 2011, ConnorMcLeod

    This plugin is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this plugin; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>

#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.1.0"
#define PLUGIN "Killer's view"

#define        m_flNextSpecButtonTime                    100
#define        m_fDeadTime                                    354

new gmsgScreenFade
new g_iMaxPlayers
new g_pCvarBlockChangeViewTime, g_pCvarKv3rdPerson, g_pCvarKvFade

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, "ConnorMcLeod")

    gmsgScreenFade = get_user_msgid("ScreenFade")

    g_iMaxPlayers = get_maxplayers()

    g_pCvarBlockChangeViewTime = register_cvar("kv_buttonsdelay", "2.0")
    g_pCvarKv3rdPerson = register_cvar("kv_3rdview", "0") // 1 = first person
    g_pCvarKvFade = register_cvar("kv_fade", "030000000180") // RRRGGGBBBAAA

    RegisterHam(Ham_Killed, "player", "OnCBasePlayer_Killed_Post", true)
}

public OnCBasePlayer_Killed_Post( id, killer )
{
    if( !killer || killer > g_iMaxPlayers || id == killer )
    {
        return
    }

    set_pev(id, pev_deadflag, DEAD_DEAD)
    new Float:flTime = get_gametime()
    set_pdata_float(id, m_fDeadTime, flTime - 3.1)
    ExecuteHam(Ham_Think, id)

    engclient_cmd(id, "specmode", get_pcvar_num(g_pCvarKv3rdPerson) ? "1" : "4")

    set_pdata_float(id, m_flNextSpecButtonTime, flTime + get_pcvar_float(g_pCvarBlockChangeViewTime))
    
    set_pev(id, pev_deadflag, DEAD_DYING)
    set_pev(id, pev_nextthink, flTime + 0.1)
    set_pdata_float(id, m_fDeadTime, flTime + 9999.0)

    new szFade[13], l = get_pcvar_string(g_pCvarKvFade, szFade, charsmax(szFade))
    if( l == 12 )
    {
        new r, g, b, a

        r = (szFade[0] - '0') * 100 + (szFade[1] - '0') * 10 + (szFade[2] - '0')
        g = (szFade[3] - '0') * 100 + (szFade[4] - '0') * 10 + (szFade[5] - '0')
        b = (szFade[6] - '0') * 100 + (szFade[7] - '0') * 10 + (szFade[8] - '0')
        a = (szFade[9] - '0') * 100 + (szFade[10] - '0') * 10 + (szFade[11] - '0')

        message_begin(MSG_ONE_UNRELIABLE, gmsgScreenFade, .player=id)
        write_short( 2<<12 )
        write_short( 1<<11 )
        write_short( 0 )
        write_byte( r )
        write_byte( g )
        write_byte( b )
        write_byte( a )
        message_end()
    }
}
djaykuteray is offline
Send a message via MSN to djaykuteray
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-21-2013 , 18:22   Re: first person view after death
Reply With Quote #3

PHP Code:
/*    Formatright © 2011, ConnorMcLeod

    This plugin is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this plugin; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>

#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.1.0"
#define PLUGIN "Killer's view"

#define        m_flNextSpecButtonTime                    100
#define        m_fDeadTime                                    354

new gmsgScreenFade
new g_iMaxPlayers
new g_pCvarBlockChangeViewTimeg_pCvarKv3rdPersong_pCvarKvFade

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
gmsgScreenFade get_user_msgid("ScreenFade")

    
g_iMaxPlayers get_maxplayers()

    
g_pCvarBlockChangeViewTime register_cvar("kv_buttonsdelay""2.0")
    
g_pCvarKv3rdPerson register_cvar("kv_3rdview""0"// 1 = first person
    
g_pCvarKvFade register_cvar("kv_fade""030000000180"// RRRGGGBBBAAA

    
RegisterHam(Ham_Killed"player""OnCBasePlayer_Killed_Post"true)
}

public 
OnCBasePlayer_Killed_Postidkiller )
{
    if( !
killer || killer g_iMaxPlayers || id == killer )
    {
        return
    }

    
set_pev(idpev_deadflagDEAD_DEAD)
    new 
Float:flTime get_gametime()
    
set_pdata_float(idm_fDeadTimeflTime 3.1)
    
ExecuteHam(Ham_Thinkid)

    
engclient_cmd(id"specmode"get_pcvar_num(g_pCvarKv3rdPerson) ? "1" "4")

    
set_pdata_float(idm_flNextSpecButtonTimeflTime get_pcvar_float(g_pCvarBlockChangeViewTime))
    
    
set_pev(idpev_deadflagDEAD_DYING)
    
set_pev(idpev_nextthinkflTime 0.1)
    
set_pdata_float(idm_fDeadTimeflTime 9999.0)

    new 
szFade[13], get_pcvar_string(g_pCvarKvFadeszFadecharsmax(szFade))
    if( 
== 12 )
    {
        new 
rgba

        r 
= (szFade[0] - '0') * 100 + (szFade[1] - '0') * 10 + (szFade[2] - '0')
        
= (szFade[3] - '0') * 100 + (szFade[4] - '0') * 10 + (szFade[5] - '0')
        
= (szFade[6] - '0') * 100 + (szFade[7] - '0') * 10 + (szFade[8] - '0')
        
= (szFade[9] - '0') * 100 + (szFade[10] - '0') * 10 + (szFade[11] - '0')

        
message_begin(MSG_ONE_UNRELIABLEgmsgScreenFade, .player=id)
        
write_short2<<12 )
        
write_short1<<11 )
        
write_short)
        
write_byte)
        
write_byte)
        
write_byte)
        
write_byte)
        
message_end()
    }

This plugin do nothing that i requested. I need first person view for a victim, i mean i don't want to see how i'm falling down and to press speace button until i will see first view of the player who killed me that takes my time.
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 04-22-2013 , 12:22   Re: first person view after death
Reply With Quote #4

Actually, since your post was vague, It does do something you requested. For clarification, after somebody kills you, you want a view that originates from where their dead body is? Or do you want a first person view of what the killer is doing after?
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-22-2013 , 14:27   Re: first person view after death
Reply With Quote #5

Quote:
Originally Posted by joshknifer
Actually, since your post was vague, It does do something you requested. For clarification, after somebody kills you, you want a view that originates from where their dead body is? Or do you want a first person view of what the killer is doing after?
I want a first person view of what the killer is doing after
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-24-2013 , 07:37   Re: first person view after death
Reply With Quote #6

Quote:
Originally Posted by TRUE RED View Post
I need first person view for a victim
Quote:
Originally Posted by TRUE RED View Post
I want a first person view of what the killer is doing after
Are you sure you know what you want?
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-24-2013 , 19:14   Re: first person view after death
Reply With Quote #7

Quote:
Originally Posted by hornet
Are you sure you know what you want?
sorry for my bad english.
Look i wanna plugin that will show first person view for a victim of a player who killed him.
more accurate: after death player (victim) see first person view of a killer (player who killed him) straight away.
anyways, hornet, if you came to this thread to have fun it's ok.

Last edited by TRUE RED; 04-24-2013 at 19:36.
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-24-2013 , 19:48   Re: first person view after death
Reply With Quote #8

Quote:
Originally Posted by TRUE RED View Post
sorry for my bad english.
Look i wanna plugin that will show first person view for a victim of a player who killed him.
more accurate: after death player (victim) see first person view of a killer (player who killed him) straight away.
anyways, hornet, if you came to this thread to have fun it's ok.
I didn't post here to have fun. I posted here to help you.
The plugin Killer's View does exactly what your asking for. Have you tried it yet?
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-24-2013 , 20:42   Re: first person view after death
Reply With Quote #9

Quote:
Originally Posted by hornet
I didn't post here to have fun. I posted here to help you.
The plugin Killer's View does exactly what your asking for. Have you tried it yet?
Yes i tried Killer's View plugin. I noticed from description that that's exactly what i'm looking for. I set cvars kv_buttonsdelay 2.0 kv_3rdview 0 kv_fade 0. But it doesn't work like i want. It doesn't change anything. If anyone will help me to set cvars for me i will appreciate, thanks
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-24-2013 , 22:24   Re: first person view after death
Reply With Quote #10

Quote:
Originally Posted by TRUE RED View Post
But it doesn't work like i want.
You haven't stated how you want it. Also kv_fade 0? Why? Read the format that has been left in the comment next to it:
Code:
g_pCvarKvFade = register_cvar("kv_fade", "030000000180") // RRRGGGBBBAAA
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 00:06.


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