Raised This Month: $85 Target: $400
 21% 

CS 1.6 Custom 3rd Person View


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-15-2009 , 16:37   Re: CS 1.6 Custom 3rd Person View
Reply With Quote #21

Quote:
Originally Posted by arkshine View Post
Change

Code:
public FwdPlayerSpawn(id) {     Create_PlayerCamera(id) }

by

Code:
public FwdPlayerSpawn(id) {     if ( is_user_alive( id ) ) Create_PlayerCamera(id) }
Oops. Forgot about that.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ZoRaN
Junior Member
Join Date: May 2009
Old 05-16-2009 , 06:12   Re: CS 1.6 Custom 3rd Person View
Reply With Quote #22

thx its working.
ZoRaN is offline
kishorawake
Junior Member
Join Date: Jan 2009
Old 05-22-2009 , 11:35   Re: CS 1.6 Custom 3rd Person View
Reply With Quote #23

i m going a bit noob ,tthis file is not compiling with1.81 and amxx file cannot be created can u plz post teh amxx file be helpfull
kishorawake is offline
kishorawake
Junior Member
Join Date: Jan 2009
Old 05-22-2009 , 11:35   Re: CS 1.6 Custom 3rd Person View
Reply With Quote #24

dear moderator can you just post the amxx file for it as it is not locally compiling
kishorawake is offline
Driving To Heaven
Senior Member
Join Date: Jun 2009
Location: somewhere far away
Old 06-26-2009 , 06:34   Re: CS 1.6 Custom 3rd Person View
Reply With Quote #25

I need 3Dwiew. When press e, not show normal wiew.
Good player model.
Good crosshair.

This code. When press e, not show normal wiew
But bad player model and crosshair not up when shooting.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "tpt"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHamHam_Spawn"player""fwSpawnPost")
}

public 
plugin_precache() precache_model("models/rpgrocket.mdl")

public 
fwSpawnPostid )
    if( 
is_user_aliveid ) ) set_viewidCAMERA_3RDPERSON 
This code. When press e, show normal wiew.
But good player model, and good crosshair.

PHP Code:
#include <amxmodx> 
#include <hamsandwich> 
#include <engine> 

#define PLUGIN "thirdperson" 
#define VERSION "1.0" 
#define AUTHOR "" 

new const pl_cm_class[] = "PlayerCamera" 

public plugin_init() 

    
register_pluginPLUGINVERSIONAUTHOR 
    
register_thinkpl_cm_class"Think_PlayerCamera" 
    
RegisterHam(Ham_Spawn"player""fwHamSpawn"1


public 
fwHamSpawnid 
    if( 
is_user_aliveid ) ) Create_PlayerCameraid ); 

Create_PlayerCamera(id)  
{  
    new 
ent = -1  
    
while ((ent find_ent_by_class(ent,pl_cm_class)) != 0)  
    {  
        if (
entity_get_edict(ent,EV_ENT_owner) == id)  
        {  
            
attach_view(id ent)  
            return  
        }  
    }  
    
ent create_entity("info_target")  
     
    if( !
ent 
        return;  
     
    
entity_set_string(entEV_SZ_classnamepl_cm_class)  
     
    
entity_set_model(ent"models/w_usp.mdl")  
     
    
entity_set_byte(entEV_INT_solidSOLID_TRIGGER)  
    
entity_set_int(entEV_INT_movetypeMOVETYPE_FLYMISSILE)  
     
    
entity_set_edict(entEV_ENT_ownerid)  
     
    
entity_set_int(ent,EV_INT_rendermodekRenderTransTexture)  
    
entity_set_float(entEV_FL_renderamt0.0 )  
     
    
attach_view(id,ent)  
    
entity_set_float(entEV_FL_nextthinkget_gametime())  
}  

public 
Think_PlayerCamera(ent)  
{  
    static 
owner  
    owner 
entity_get_edict(ent,EV_ENT_owner)  
     
    static 
iButtons;  
    
iButtons entity_get_int(ownerEV_INT_button)  
     
    if( 
iButtons IN_USE  || !is_user_alive(owner))  
    {  
        
attach_view(owner,owner)  
        
remove_entity(ent)  
        return 
PLUGIN_CONTINUE;  
    }  
     
     
    static 
Float:origin[3], Float:fAngle[3],Float:origin2[3];  
    
entity_get_vector(owner,EV_VEC_origin,origin)  
    
entity_get_vector(owner,EV_VEC_v_angle,fAngle)  
     
    
origin2[0] = origin[0]  
    
origin2[1] = origin[1]  
    
origin2[2] = origin[2]  
     
    static 
Float:fVBack[3];  
    
angle_vectorfAngleANGLEVECTOR_FORWARDfVBack );  
     
    
origin[2] += 20.0;  
     
    
origin[0] += ( -fVBack[0] * 150.0 );  
    
origin[1] += ( -fVBack[1] * 150.0 );  
    
origin[2] += ( -fVBack[2] * 150.0 );  
     
    
trace_line(owner,origin2,origin,origin)  
     
    
entity_set_vector(ent,EV_VEC_origin,origin)  
     
    
entity_get_vector(owner,EV_VEC_velocity,origin2)  
    
entity_set_vector(ent,EV_VEC_velocity,origin2)  
     
    
entity_set_vector(ent,EV_VEC_angles,fAngle)  
    
entity_set_float(entEV_FL_nextthinkget_gametime())  
     
    return 
PLUGIN_CONTINUE;  

Driving To Heaven is offline
vermillioN25
Member
Join Date: Apr 2009
Location: Brazil
Old 07-08-2009 , 11:38   Re: CS 1.6 Custom 3rd Person View
Reply With Quote #26

Whats better? Fakemeta or engine?

@Driving to Heaven
Well, I'm not a good script, so try this:

Code:
#include <amxmodx>
#include <engine>

#define PLUGIN "3rd Camera View" 
#define VERSION "1.0" 
#define AUTHOR "" 

new const pl_cm_class[] = "PlayerCamera"

public plugin_init()
{
    register_clcmd( "say /cam", "cmdCam" )
    register_think(pl_cm_class,"Think_PlayerCamera")
}

public cmdCam(id)
    Create_PlayerCamera(id)

Create_PlayerCamera(id)
{
    new ent = -1
    while ((ent = find_ent_by_class(ent,pl_cm_class)) != 0)
    {
        if (entity_get_edict(ent,EV_ENT_owner) == id)
        {
        attach_view(id , ent)
        return
        }
    }
    ent = create_entity("info_target")
    
    if( !ent )
    return;
    
    entity_set_string(ent, EV_SZ_classname, pl_cm_class)
    
    entity_set_model(ent, "models/w_usp.mdl")
    
    entity_set_byte(ent, EV_INT_solid, SOLID_TRIGGER)
    entity_set_int(ent, EV_INT_movetype, MOVETYPE_FLYMISSILE)
    
    entity_set_edict(ent, EV_ENT_owner, id)
    
    entity_set_int(ent,EV_INT_rendermode, kRenderTransTexture)
    entity_set_float(ent, EV_FL_renderamt, 0.0 )
    
    attach_view(id,ent)
    entity_set_float(ent, EV_FL_nextthink, get_gametime())
}

public Think_PlayerCamera(ent)
{
    static owner
    owner = entity_get_edict(ent,EV_ENT_owner)
    
    static iButtons;
    iButtons = entity_get_int(owner, EV_INT_button)
    
    /* USE E BUTTON REMOVE
if( iButtons & IN_USE  || !is_user_alive(owner))
    {
        attach_view(owner,owner)
        remove_entity(ent)
        return PLUGIN_CONTINUE;
    }
    */
    
    static Float:origin[3], Float:fAngle[3],Float:origin2[3];
    entity_get_vector(owner,EV_VEC_origin,origin)
    entity_get_vector(owner,EV_VEC_v_angle,fAngle)
    
    origin2[0] = origin[0]
    origin2[1] = origin[1]
    origin2[2] = origin[2]
    
    static Float:fVBack[3];
    angle_vector( fAngle, ANGLEVECTOR_FORWARD, fVBack );
    
    origin[2] += 20.0;
    
    origin[0] += ( -fVBack[0] * 150.0 );
    origin[1] += ( -fVBack[1] * 150.0 );
    origin[2] += ( -fVBack[2] * 150.0 );
    
    trace_line(owner,origin2,origin,origin)
    
    entity_set_vector(ent,EV_VEC_origin,origin)
    
    entity_get_vector(owner,EV_VEC_velocity,origin2)
    entity_set_vector(ent,EV_VEC_velocity,origin2)
    
    entity_set_vector(ent,EV_VEC_angles,fAngle)
    entity_set_float(ent, EV_FL_nextthink, get_gametime())
    
    return PLUGIN_CONTINUE;
}


Or this

Code:

public Think_PlayerCamera(ent)
{

    /* USE E BUTTON REMOVE
    static owner
    owner = entity_get_edict(ent,EV_ENT_owner)
    
    static iButtons;
    iButtons = entity_get_int(owner, EV_INT_button)
    

if( iButtons & IN_USE  || !is_user_alive(owner))
    {
        attach_view(owner,owner)
        remove_entity(ent)
        return PLUGIN_CONTINUE;
    }
    */
Tell me if works
__________________

Last edited by vermillioN25; 07-08-2009 at 15:52.
vermillioN25 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-08-2009 , 11:58   Re: CS 1.6 Custom 3rd Person View
Reply With Quote #27

engine here
__________________
Working on : CS Weapon Mod (72%) , MonsterAI (PAUSED),

Arkshine is offline
amokossi
Senior Member
Join Date: Apr 2008
Old 07-16-2009 , 04:38   Re: CS 1.6 Custom 3rd Person View
Reply With Quote #28

This could be very useful for Soccerjam right? Hm thinkling about to try to use it on SJ-Maps only.
amokossi is offline
Send a message via ICQ to amokossi Send a message via MSN to amokossi
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-21-2009 , 18:28   Re: CS 1.6 Custom 3rd Person View
Reply With Quote #29

Working version with less code, with smoth moves :

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>

#define VERSION "0.0.1"

#define MAX_PLAYERS    32

#define    m_flWait        42

#define USE_TOGGLE 3

new g_iCam[MAX_PLAYERS+1]
new 
g_iMaxPlayers

public plugin_init()
{
    
register_plugin("Camera View"VERSION"ConnorMcLeod")

    
register_clcmd("say /cam""cam")
    
register_think("trigger_camera""Camera_Think")
    
g_iMaxPlayers get_maxplayers()
}

public 
camid )
{
    if( !
is_user_alive(id) )
    {
        return
    }
    new 
iEnt g_iCam[id]
    if( !
is_valid_ent(iEnt) )
    {
        
iEnt create_entity("trigger_camera")

        
entity_set_int(iEntEV_INT_spawnflagsSF_CAMERA_PLAYER_TARGET|SF_CAMERA_PLAYER_POSITION)

        
DispatchSpawn(iEnt)
        
set_pdata_float(iEntm_flWait999999.04)

        
g_iCam[id] = iEnt
    
}

    
ExecuteHamHam_UseiEntididUSE_TOGGLE1.0)

    
entity_set_int(idEV_INT_flagsentity_get_int(idEV_INT_flags) & ~FL_FROZEN)
    
cs_reset_user_maxspeed(id)
}

public 
client_disconnect(id)
{
    new 
iEnt g_iCam[id]
    if( !
is_valid_ent(iEnt) )
    {
        
g_iCam[id] = 0
        remove_entity
(iEnt)
    }
}

cs_reset_user_maxspeed(id)
{
    new 
Float:flMaxSpeed;
    switch ( 
get_user_weapon(id) )
    {
        case 
CSW_SG550CSW_AWPCSW_G3SG1 flMaxSpeed 210.0;
        case 
CSW_M249 flMaxSpeed 220.0;
        case 
CSW_AK47 flMaxSpeed 221.0;
        case 
CSW_M3CSW_M4A1 flMaxSpeed 230.0;
        case 
CSW_SG552 flMaxSpeed 235.0;
        case 
CSW_XM1014CSW_AUGCSW_GALILCSW_FAMAS flMaxSpeed 240.0;
        case 
CSW_P90 flMaxSpeed 245.0;
        case 
CSW_SCOUT flMaxSpeed 260.0;
        default : 
flMaxSpeed 250.0;
    }
    
set_user_maxspeed(idflMaxSpeed);
}

get_cam_owner(iEnt)
{
    static 
id
    
for(id 1id<=g_iMaxPlayersid++)
    {
        if( 
g_iCam[id] == iEnt )
        {
            return 
id
        
}
    }
    return 
0
}

public 
Camera_Think(entid)
{
    new 
id get_cam_owner(entid);
    if( !
id )
    {
        return
    }

    static 
Float:origin[3], Float:angle[3], Float:vBack[3];
    
entity_get_vectoridEV_VEC_originorigin );
    
entity_get_vectoridEV_VEC_v_angleangle );

    
angle_vectorangleANGLEVECTOR_FORWARDvBack );

    
origin[2] += 20.0//So we're closer to the eyes.

    //Move back to see ourself (150 units)
    
origin[0] += (-vBack[0] * 150.0);
    
origin[1] += (-vBack[1] * 150.0);
    
origin[2] += (-vBack[2] * 150.0);

    
entity_set_originentidorigin );
    
entity_set_vectorentidEV_VEC_anglesangle );  

    
entity_set_float(entidEV_FL_nextthinkget_gametime())

__________________
- tired and retired -

Last edited by ConnorMcLeod; 07-21-2009 at 18:31.
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-21-2009 , 19:38   Re: CS 1.6 Custom 3rd Person View
Reply With Quote #30

Any chance of a Mod independent version of this? I was testing code for TFC and changing player models and would have really liked this since I was the only person on my listen server.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 09:24.


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