Raised This Month: $51 Target: $400
 12% 

Obscura Cam (New 3rd Person) [v0.7]


Post New Thread Reply   
 
Thread Tools Display Modes
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 03-18-2016 , 14:15   Re: Obscura Cam (New 3rd Person) [v0.6]
Reply With Quote #11

0.6 Released.

Version 0.6:
*Improved the way the camera is removed.
*Fixed a bug when the player disconnected. it would say "invalid player".
__________________
Contact: Steam
Videos: Youtube
SkumTomteN is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 03-19-2016 , 14:10   Re: Obscura Cam (New 3rd Person) [v0.6]
Reply With Quote #12

Well i have some advices, they are not really necessary, but it makes the code looks more nice.

You have some cases like this
PHP Code:
if(is_user_alive(iVictim))
        return 
HAM_IGNORED;
    if(!
is_user_connected(iVictim))
        return 
HAM_IGNORED

PHP Code:
if(!is_user_connected(iVictim) || is_user_alive(iVictim))
        return 
HAM_IGNORED
or
PHP Code:
if(is_user_connected(iVictim) && !is_user_alive(iVictim))
{
    
//Your code


Also, you could change this
PHP Code:
public CMD_ToggleCam(iPlayer)
{
    if(
get_pcvar_num(g_pCvar_iCameraForced))
    {
        
client_printc(iPlayer"!g[%s]!n Camera is forced on !t3rd person!n by server manager!"PLUGIN_TAG)
        return;
    }
    if(
is_user_alive(iPlayer))
    {
        if(!
g_bInThirdPerson[iPlayer])
        {
            
Set_CameraEnt(iPlayer)
            
            
g_bInThirdPerson[iPlayer] = true;

            
client_print(0print_center"3rd Person Mode")
        }
        else 
        {
            
Remove_CameraEnt(iPlayer1)
    
            
g_bInThirdPerson[iPlayer] = false;
            
            
client_print(0print_center"1st Person Mode")
        }
    }
    else 
/* He toggles when not alive */
    
{
        if(!
g_bInThirdPerson[iPlayer])
        {
            
g_bInThirdPerson[iPlayer] = true;
        }
        else 
g_bInThirdPerson[iPlayer] = false;
        
        
client_printc(iPlayer"!g[%s]!n Your camera will be !t%s!n when you spawn!"PLUGIN_TAGg_bInThirdPerson[iPlayer] ? "3rd Person" "1st Person")
    }


PHP Code:
public CMD_ToggleCam(iPlayer)
{
    if(
get_pcvar_num(g_pCvar_iCameraForced))
    {
        
client_printc(iPlayer"!g[%s]!n Camera is forced on !t3rd person!n by server manager!"PLUGIN_TAG)
        return;
    }
    
    
g_bInThirdPerson[iPlayer] = ~g_bInThirdPerson[iPlayer]
    
    if(
is_user_alive(iPlayer))
    {
        if(
g_bInThirdPerson[iPlayer])
        {
            
Set_CameraEnt(iPlayer)

            
client_print(0print_center"3rd Person Mode")
        }
        else 
        {
            
Remove_CameraEnt(iPlayer1)
            
            
client_print(0print_center"1st Person Mode")
        }
    }
    else 
/* He toggles when not alive */
    
{
        
client_printc(iPlayer"!g[%s]!n Your camera will be !t%s!n when you spawn!"PLUGIN_TAGg_bInThirdPerson[iPlayer] ? "3rd Person" "1st Person")
    }


And last:
PHP Code:
public fw_PlayerSpawn_Post(iPlayer)
{
    if(!
is_user_alive(iPlayer))
        return 
HAM_IGNORED;
    if(!
is_user_connected(iPlayer))
        return 
HAM_IGNORED;
    
    if(
get_pcvar_num(g_pCvar_iCameraForced))
    {
        
Set_CameraEnt(iPlayer)
    }
    else
    {
        if(
g_bInThirdPerson[iPlayer])
            
Set_CameraEnt(iPlayer)
        else 
            
Remove_CameraEnt(iPlayer1)
    }
    return 
HAM_HANDLED;


PHP Code:
public fw_PlayerSpawn_Post(iPlayer)
{
    if(
is_user_alive(iPlayer))
    {
        if(
get_pcvar_num(g_pCvar_iCameraForced) || g_bInThirdPerson[iPlayer])
        {
            
Set_CameraEnt(iPlayer)
        }
        else
        {
            
Remove_CameraEnt(iPlayer1)
        }
    }

They are not really necessary, but it's always good to improve it.
__________________
Jhob94 is offline
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 03-19-2016 , 17:47   Re: Obscura Cam (New 3rd Person) [v0.6]
Reply With Quote #13

Its been implemented in the code now, you were always so good in coding style, im jealous.
But i prefer to use "return" when im not using an if > else, just a preference.

Thank you for the suggestions and improvement. ill add you to credits
__________________
Contact: Steam
Videos: Youtube
SkumTomteN is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 03-22-2016 , 16:06   Re: Obscura Cam (New 3rd Person) [v0.6]
Reply With Quote #14

Quote:
Originally Posted by Jhob94 View Post
PHP Code:
...
        if(
get_pcvar_num(g_pCvar_iCameraForced) || g_bInThirdPerson[iPlayer])
... 

PHP Code:
if(g_bInThirdPerson[iPlayer] || get_pcvar_num(g_pCvar_iCameraForced)) 
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 03-22-2016 , 16:11   Re: Obscura Cam (New 3rd Person) [v0.6]
Reply With Quote #15

Quote:
Originally Posted by GuskiS View Post

PHP Code:
if(g_bInThirdPerson[iPlayer] || get_pcvar_num(g_pCvar_iCameraForced)) 
Doesn't matter. If cvar is enabled, would be better the other case. It's 50/50, so i am not sure why you posted that.
__________________
Jhob94 is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 03-23-2016 , 02:39   Re: Obscura Cam (New 3rd Person) [v0.7]
Reply With Quote #16

It does matter. I posted that because it is wiser to check on array than on native first because if array will return true, it won't check the other expression to be true. This can be really usefull in functions/events that are being called very often
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness

Last edited by GuskiS; 03-23-2016 at 02:40.
GuskiS is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 03-23-2016 , 13:33   Re: Obscura Cam (New 3rd Person) [v0.7]
Reply With Quote #17

Quote:
Originally Posted by GuskiS View Post
This can be really usefull in functions/events that are being called very often
Yes, i know. But here isn't really the case.
__________________
Jhob94 is offline
Visinescu
Senior Member
Join Date: Dec 2015
Location: England now,Home Romania
Old 03-25-2016 , 14:24   Re: Obscura Cam (New 3rd Person) [v0.7]
Reply With Quote #18

I don't see this plugin to be approved... make more camera views like the shoulder view, and fix that wallhack plis.
Visinescu is offline
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 03-25-2016 , 22:18   Re: Obscura Cam (New 3rd Person) [v0.7]
Reply With Quote #19

More camera angles!: The purpose of the plugin is a simple cam. but as always, if anyone wants to make more angles, post your code here.
Fix wallhack: I don't have time to fix that issue, it would take a very long time and testing. but if anyone wants to support this plugin by giving a suggestion code for this, feel free
__________________
Contact: Steam
Videos: Youtube

Last edited by SkumTomteN; 04-15-2016 at 13:09.
SkumTomteN is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-18-2016 , 15:26   Re: 3rd Person Camera (Nani-Cam)
Reply With Quote #20

Quote:
Originally Posted by SkumTomteN View Post
If you want to see in detail what is different, i suggest you compare it yourself.

Wrong, if it's your plugin you have the responsability to say the differences between the others similar versions, anyway it's kind of useless. Same can be achieved very easy with engine.
__________________
Project: Among Us

Last edited by Craxor; 09-18-2016 at 15:26.
Craxor is offline
Send a message via ICQ to Craxor
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 02:53.


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