Raised This Month: $ Target: $400
 0% 

About 3rd persion view


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Osker Lee
Member
Join Date: Jul 2011
Old 08-26-2011 , 13:46   About 3rd persion view
Reply With Quote #1

Hey guys,I found this plugin: Camera View Menu.
http://forums.alliedmods.net/showthread.php?p=121912

It can change to 3rd persion view,but I found player model was transparent in 3rd persion view.I tried to add this code,but it didn't become opaque.
Quote:
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
Anyone who know how to make player model opaque?
PHP Code:
#include <amxmodx>
#include <engine>
#include <amxmisc>
public plugin_init()
{
    
register_plugin("Camera Changer""1.0""XunTric")
    
register_menucmd(register_menuid("Choose Camera View"), 1023"setview"
    
register_clcmd("say /camera""chooseview")
    
register_clcmd("say_team /camera""chooseview")
    
register_clcmd("say /cam""chooseview")
    
register_clcmd("say_team /cam""chooseview")    
}
public 
plugin_modules()
{
    
require_module("engine")
}
public 
plugin_precache()
{
    
precache_model("models/rpgrocket.mdl")
}
public 
chooseview(id)
{
    new 
menu[192
    new 
keys MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3 
    format
(menu191"Choose Camera View^n^n1. 3rd Person View^n2. Upside View^n3. Normall View^n^n0. Exit"
    
show_menu(idkeysmenu)      
    return 
PLUGIN_CONTINUE
}
public 
setview(idkeymenu)
{
    if(
key == 0) {
         
set_view(idCAMERA_3RDPERSON)
         return 
PLUGIN_HANDLED
    
}
    if(
key == 1) {
         
set_view(idCAMERA_TOPDOWN)
         return 
PLUGIN_HANDLED
    
}
    if(
key == 2) {
         
set_view(idCAMERA_NONE)
         return 
PLUGIN_HANDLED
    
}
    else {
         return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED

Attached Thumbnails
Click image for larger version

Name:	01.jpg
Views:	280
Size:	91.0 KB
ID:	91300   Click image for larger version

Name:	02.jpg
Views:	286
Size:	93.9 KB
ID:	91301  
Osker Lee is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-26-2011 , 15:55   Re: About 3rd persion view
Reply With Quote #2

You have to hook AddToFullPack and set player properties there withe set_es native.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-26-2011 , 17:25   Re: About 3rd persion view
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
You have to hook AddToFullPack and set player properties there withe set_es native.
That's quite bad idea because set_view uses AddToFullPack too. More proper way would be add new param in set_view to not change render.
__________________
xPaw is offline
Osker Lee
Member
Join Date: Jul 2011
Old 08-26-2011 , 17:25   Re: About 3rd persion view
Reply With Quote #4

PHP Code:
public func_AddToFullPack(es_handleeenthosthostflagsplayerpSet)
{
if(!
player)
{
return 
FMRES_IGNORED
}
set_es(entES_RenderFxkRenderFxDistort)
set_es(entES_RenderColor, {000})
set_es(entES_RenderModekRenderTransAdd)
set_es(entES_RenderAmt127)
}
return 
FMRES_IGNORED 

Just like this?I am not familiar with 'AddToFullPack',can you tell me how to modify?
Osker Lee is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-27-2011 , 03:57   Re: About 3rd persion view
Reply With Quote #5

Quote:
Originally Posted by xPaw View Post
That's quite bad idea because set_view uses AddToFullPack too. More proper way would be add new param in set_view to not change render.
That's why you need to set properties back in this forward... unless you xPaw can update that native


Osker Lee :
PHP Code:
public plugin_init()
{
    
register_forward(FM_AddToFullPack"AddToFullPack_Post"1)
}

public 
AddToFullPack_Post(es_handleeenthosthostflagsplayerpSet)
{
    if( 
player && ent == host && CHECK_CAMERA_VIEW_HERE(id) )
    {
        
set_es(entES_RenderModekRenderNone)
        
set_es(entES_RenderAmt0)
    } 

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-27-2011 at 04:03.
ConnorMcLeod is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-27-2011 , 06:32   Re: About 3rd persion view
Reply With Quote #6

Or you can use an custom one and edit out the transpearency part
https://forums.alliedmods.net/showthread.php?t=65427
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Osker Lee
Member
Join Date: Jul 2011
Old 08-28-2011 , 19:06   Re: About 3rd persion view
Reply With Quote #7

Quote:
Or you can use an custom one and edit out the transpearency part
https://forums.alliedmods.net/showthread.php?t=65427
Thx!But there is only one view type: CAMERA_3RDPERSON,how to change to CAMERA_UPLEFT or CAMERA_TOPDOWN?
PHP Code:
#include <amxmodx> 
#include <engine> 
#define PLUGIN "Player Camera"
#define VERSION "1.0"
#define AUTHOR "ot_207"
new const pl_cm_class[] = "PlayerCamera" 
public plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd"say /cam""cmdCam" 
    
register_think(pl_cm_class,"Think_PlayerCamera"

public 
cmdCam(id
    
Create_PlayerCamera(id
Create_PlayerCamera(id

    new 
ent = -
    
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

Osker Lee is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-29-2011 , 00:53   Re: About 3rd persion view
Reply With Quote #8

Better to use the plugin you linked and to insert the code i gave you.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
GarbageBox
Senior Member
Join Date: Feb 2010
Old 08-29-2011 , 14:21   Re: About 3rd persion view
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
That's why you need to set properties back in this forward... unless you xPaw can update that native


Osker Lee :
PHP Code:
public plugin_init()
{
    
register_forward(FM_AddToFullPack"AddToFullPack_Post"1)
}

public 
AddToFullPack_Post(es_handleeenthosthostflagsplayerpSet)
{
    if( 
player && ent == host && CHECK_CAMERA_VIEW_HERE(id) )
    {
        
set_es(entES_RenderModekRenderNone)
        
set_es(entES_RenderAmt0)
    } 

Bump! I also want to know.
But do you mean "kRenderFxNone"?
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others
GarbageBox is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-29-2011 , 15:32   Re: About 3rd persion view
Reply With Quote #10

No, i meant kRenderNormal.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 04:14.


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