Raised This Month: $32 Target: $400
 8% 

3rd Vision Mode


Post New Thread Reply   
 
Thread Tools Display Modes
Apb hq
Senior Member
Join Date: Apr 2014
Old 12-12-2018 , 15:49   Re: 3rd Vision Mode
Reply With Quote #11

Has anyone tried to fix this issue
Thanks in advance
Apb hq is offline
Mark.uG
AlliedModders Donor
Join Date: Oct 2014
Old 12-15-2018 , 01:57   Re: 3rd Vision Mode
Reply With Quote #12

Quote:
Originally Posted by Apb hq View Post
Has anyone tried to fix this issue
Thanks in advance
I like this one

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

new bool:g_bHasView[33]

public plugin_init()
{
    register_plugin("Camera Changer", "1.0", "XunTric")

    register_clcmd("say /cam", "setview")
    register_clcmd("say_team /cam", "setview")  
    
    arrayset(g_bHasView, false, 32)
}

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

public setview(id)
{
    if (g_bHasView[id] == false)
    {
        set_view(id, CAMERA_3RDPERSON)
        g_bHasView[id] = true
    }
    else
    {
        set_view(id, CAMERA_NONE)
        g_bHasView[id] = false
    }
}

Last edited by Mark.uG; 12-15-2018 at 01:58.
Mark.uG is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-15-2018 , 14:50   Re: 3rd Vision Mode
Reply With Quote #13

It's not the same. Also, it has already been told...
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Apb hq
Senior Member
Join Date: Apr 2014
Old 03-14-2019 , 10:01   Re: 3rd Vision Mode
Reply With Quote #14

Has anyone an idea how to fix the given issue ?
Apb hq is offline
Old 03-14-2019, 13:30
Natsheh
This message has been deleted by Natsheh.
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-14-2019 , 13:33   Re: 3rd Vision Mode
Reply With Quote #15

Quote:
Originally Posted by Natsheh View Post
PHP Code:

#include <amxmodx> 
#include <fakemeta> 
#include <hamsandwich> 

#define VERSION "0.0.3" 

#define USE_TOGGLE 3

#define MAX_BACKWARD_UNITS    -200.0
#define MAX_FORWARD_UNITS    200.0

new g_iPlayerCamera[33], Float:g_camera_position[33];

public 
plugin_init()
{
    
register_plugin("Camera View Menu"VERSION"ConnorMcLeod & Natsheh"
    
    
register_clcmd("say /cam""camera_menu")
    
register_clcmd("say_team /cam""camera_menu")
    
    
register_forward(FM_SetView"SetView"
    
RegisterHam(Ham_Think"trigger_camera""Camera_Think")
}

public 
camera_menu(id)
{
    if(!
is_user_alive(id)) return;
    
    new 
menu menu_create("Choose an option!""cam_m_handler"), sText[48], bool:mode = (g_iPlayerCamera[id] > 0) ? true:false;
    
    
formatex(sTextcharsmax(sText), "%s \r3RD Person camera!", (mode) ? "\dDisable":"\yEnable")
    
menu_additem(menusText)
    
    if(
mode)
    {
        
menu_additem(menu"Forward Further!")
        
menu_additem(menu"Backward Further!")
    }
    
    
menu_display(idmenu)
}

public 
cam_m_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
1;
    }
    
    
menu_destroy(menu);
    
    if(
g_iPlayerCamera[id] > && item == 0)
    {
        
client_disconnect(id)
        
engfunc(EngFunc_SetViewidid);
    }
    else
    {
        switch( 
item )
        {
            case 
0:
            {
                
g_camera_position[id] = -150.0;
                
enable_camera(id)
            }
            case 
1: if(g_camera_position[id] < MAX_FORWARD_UNITSg_camera_position[id] += 50.0;
            case 
2: if(g_camera_position[id] > MAX_BACKWARD_UNITSg_camera_position[id] -= 50.0;
        }
    }
    
    return 
1;
}

public 
enable_camera(id)

    if(!
is_user_alive(id)) return;
    
    new 
iEnt g_iPlayerCamera[id
    if(!
pev_valid(iEnt))
    {
        static 
iszTriggerCamera 
        
if( !iszTriggerCamera 
        { 
            
iszTriggerCamera engfunc(EngFunc_AllocString"trigger_camera"
        } 
        
        
iEnt engfunc(EngFunc_CreateNamedEntityiszTriggerCamera);
        
set_kvd(0KV_ClassName"trigger_camera"
        
set_kvd(0KV_fHandled0
        
set_kvd(0KV_KeyName"wait"
        
set_kvd(0KV_Value"999999"
        
dllfunc(DLLFunc_KeyValueiEnt0
    
        
set_pev(iEntpev_spawnflagsSF_CAMERA_PLAYER_TARGET|SF_CAMERA_PLAYER_POSITION
        
set_pev(iEntpev_flagspev(iEntpev_flags) | FL_ALWAYSTHINK
    
        
dllfunc(DLLFunc_SpawniEnt)
    
        
g_iPlayerCamera[id] = iEnt;
 
//   }     
        
new Float:flMaxSpeediFlags pev(idpev_flags
        
pev(idpev_maxspeedflMaxSpeed)
        
        
ExecuteHam(Ham_UseiEntididUSE_TOGGLE1.0)
        
        
set_pev(idpev_flagsiFlags)
        
// depending on mod, you may have to send SetClientMaxspeed here. 
        // engfunc(EngFunc_SetClientMaxspeed, id, flMaxSpeed) 
        
set_pev(idpev_maxspeedflMaxSpeed)
    }
}

public 
SetView(idiEnt

    if(
is_user_alive(id))
    {
        new 
iCamera g_iPlayerCamera[id
        if( 
iCamera && iEnt != iCamera 
        { 
            new 
szClassName[16
            
pev(iEntpev_classnameszClassNamecharsmax(szClassName)) 
            if(!
equal(szClassName"trigger_camera")) // should let real cams enabled 
            

                
engfunc(EngFunc_SetViewidiCamera// shouldn't be always needed 
                
return FMRES_SUPERCEDE 
            

        } 
    } 
    return 
FMRES_IGNORED 
}

public 
client_disconnect(id

    new 
iEnt g_iPlayerCamera[id];
    if(
pev_valid(iEnt)) engfunc(EngFunc_RemoveEntityiEnt);
    
g_iPlayerCamera[id] = 0;
    
g_camera_position[id] = -100.0;


public 
client_putinserver(id
{
    
g_iPlayerCamera[id] = 0
    g_camera_position
[id] = -100.0;


get_cam_owner(iEnt

    new 
players[32], pnum;
    
get_players(playerspnum"ch");
    
    for(new 
idipnumi++)
    { 
        
id players[i];
        
        if(
g_iPlayerCamera[id] == iEnt)
        {
            return 
id;
        }
    }
    
    return 
0;


public 
Camera_Think(iEnt)
{
    static 
id;
    if(!(
id get_cam_owner(iEnt))) return ;
    
    static 
Float:fVecPlayerOrigin[3], Float:fVecCameraOrigin[3], Float:fVecAngles[3], Float:fVec[3];
    
    
pev(idpev_originfVecPlayerOrigin
    
pev(idpev_view_ofsfVecAngles)
        
fVecPlayerOrigin[2] += VecAngles[2];
    
pev(idpev_v_anglefVecAngles)
    
    
angle_vector(fVecAnglesANGLEVECTOR_FORWARDfVec);
    static 
Float:unitsunits g_camera_position[id];
    
    
//Move back/forward to see ourself
    
fVecCameraOrigin[0] = fVecPlayerOrigin[0] + (fVec[0] * units)
    
fVecCameraOrigin[1] = fVecPlayerOrigin[1] + (fVec[1] * units
    
fVecCameraOrigin[2] = fVecPlayerOrigin[2] + (fVec[2] * units) + 15.0
    
    
static tr2tr2 create_tr2();
    
engfunc(EngFunc_TraceLinefVecPlayerOriginfVecCameraOriginIGNORE_MONSTERSidtr2)
    static 
Float:flFraction 
    get_tr2
(tr2TR_flFractionflFraction)
    if( 
flFraction != 1.0 // adjust camera place if close to a wall 
    
{
        
flFraction *= units;
        
fVecCameraOrigin[0] = fVecPlayerOrigin[0] + (fVec[0] * flFraction);
        
fVecCameraOrigin[1] = fVecPlayerOrigin[1] + (fVec[1] * flFraction);
        
fVecCameraOrigin[2] = fVecPlayerOrigin[2] + (fVec[2] * flFraction);
    }
    
    if(
units 0.0)
    {
        
fVecAngles[0] *= fVecAngles[0] > 180.0 1:-1
        fVecAngles
[1] += fVecAngles[1] > 180.0 ? -180.0:180.0
    
}
    
    
set_pev(iEntpev_originfVecCameraOrigin); 

        static 
iVec[3];
        
get_user_origin(idiVec3);
        
IVecFVec(iVecfVec);
        
xs_vec_sub(fVecfVecCameraOriginfVec);
        
xs_vec_normalize(fVecfVec);
        
vector_angle(fVecfVec);
    
set_pev(iEntpev_anglesfVec);
    
    
free_tr2(tr2);


Try this..
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-14-2019 at 14:44.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Apb hq
Senior Member
Join Date: Apr 2014
Old 03-14-2019 , 14:41   Re: 3rd Vision Mode
Reply With Quote #16

Quote:
Originally Posted by Natsheh View Post
Try this..
Works good now but there is an issue with the menu when you write for the first time /cam and you select enable third view your crosshair is in the sky , and you have to rewrite /cam to fix it
edit: Btw i dont understant the menu what it does ?

Last edited by Apb hq; 03-14-2019 at 14:50.
Apb hq is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-14-2019 , 14:44   Re: 3rd Vision Mode
Reply With Quote #17

Quote:
Originally Posted by Apb hq View Post
Works good now but there is an issue with the menu when you write for the first time /cam and you select enable third view your crosshair is in the sky , and you have to rewrite /cam to fix it
edit: Btw i dont understant the menu what it does ?
fixed *

basically the menu allow the user to move the camera position forward or backward..
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
thEsp
BANNED
Join Date: Aug 2017
Old 03-14-2019 , 14:50   Re: 3rd Vision Mode
Reply With Quote #18

I don't know if the problem is at view angle or aiming origin, but you can get some example from i aim good plugin.
thEsp is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-14-2019 , 14:58   Re: 3rd Vision Mode
Reply With Quote #19

Quote:
Originally Posted by thEsp View Post
I don't know if the problem is at view angle or aiming origin, but you can get some example from i aim good plugin.
its from entity angles
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 02-26-2023 , 04:58   Re: 3rd Vision Mode
Reply With Quote #20

Quote:
Originally Posted by Natsheh View Post
Try this..
Error
PHP Code:
//// camv0.3.sma
//
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\camv0.3.sma(55) : warning 233: symbol "client_disconnect" is marked as deprecated: Use client_disconnected() instead.
//
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\camv0.3.sma(134) : warning 233: symbol "client_disconnect" is marked as deprecated: Use client_disconnected() instead.
//
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\camv0.3.sma(174) : warning 217: loose indentation
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\camv0.3.sma(174) : error 017: undefined symbol "VecAngles"
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\camv0.3.sma(174) : warning 215: expression has no effect
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\camv0.3.sma(174) : error 001: expected token: ";", but found "]"
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\camv0.3.sma(174) : error 029: invalid expression, assumed zero
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\camv0.3.sma(174) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
// Could not locate output file compiled\camv0.3.amx (compile failed).
//
// Compilation Time: 1,75 sec
// ---------------------------------------- 
__________________
Extended Arm Weapon Skin v2.1 {16/Apr/23}
(Detect which class is and associate it with the corresponding arms)
SideWeapons v0.2 {01/Sep/22}
(New version of Back Weapons v1.87)

SoulWeaver16 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:37.


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