Raised This Month: $ Target: $400
 0% 

[ReQ] First/Third Person Switching


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
frank_freeman
Member
Join Date: Nov 2012
Old 11-06-2012 , 16:46   [ReQ] First/Third Person Switching
Reply With Quote #1

I would be very glad, if someone could provide a simple first person/third person switching plugin (bindable to a key for the clients). Thank you very much in advance!
frank_freeman is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-07-2012 , 07:31   Re: [ReQ] First/Third Person Switching
Reply With Quote #2

It's always bindable for a player... But if someone puts in a code to bind it automaticly, it's called Slowhacking which isn't allowed on these forums.

Anyways, untested:

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>

new bool:In3rd[33]

public 
plugin_init() {
    
register_plugin("[Cam] Camera""1.0.0""NapoleoN#")
    
register_clcmd("say /cam""CmdCam")
}

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

public 
client_putinserver(id) {
    
set_task(10.0"ShowMessage"id)
    
set_task(20.0"ShowMessage2"id)
}

public 
ShowMessage(id) {
    
client_print(idprint_chat"[CAM] To switch to 3RD Cam, simply type /cam.")
}

public 
ShowMessage2(id) {
    
client_print(idprint_chat"[CAM] To bind the cam option, simply type: bind <key> ^"say /cam^".")
}

public 
CmdCam(id) {
    if(!
is_user_alive(id)) {
        
client_print(idprint_center"[CAM] You need to be alive to switch cam!")
        return 
PLUGIN_HANDLED
    
}
    
    if(!
In3rd[id]) {
        
set_view(idCAMERA_3RDPERSON
        
client_print(idprint_center"[CAM] Camera switched to 3RD Person!")
    }
    else if(
In3rd[id]) {
        
set_view(idCAMERA_NONE)
        
client_print(idprint_center"[CAM] Camera switched to Normal!")
    }
    return 
PLUGIN_HANDLED

Added some messages in it so people know how to bind the option to directly switch cam.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
frank_freeman
Member
Join Date: Nov 2012
Old 11-07-2012 , 11:38   Re: [ReQ] First/Third Person Switching
Reply With Quote #3

Thank you very much for coding this! I forgot to mention, that I'll need this plugin for my custom HLDM-mod (played on small private LAN parties). Would this plugin be compatible with mods related to regular HLDM? So to toggle/switch the camera I have to bind the command "say /cam"?
frank_freeman is offline
Old 11-07-2012, 12:05
tfk94
This message has been deleted by YamiKaitou. Reason: cross-thread bump
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-07-2012 , 12:34   Re: [ReQ] First/Third Person Switching
Reply With Quote #4

you can bind for example:
bind "F" "say /cam"
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
frank_freeman
Member
Join Date: Nov 2012
Old 11-07-2012 , 12:37   Re: [ReQ] First/Third Person Switching
Reply With Quote #5

Is it possible to set the distance from the player to the cam (to have a "closer feeling")?
frank_freeman is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-07-2012 , 12:39   Re: [ReQ] First/Third Person Switching
Reply With Quote #6

Not as far as i know. Ask ConorMcLeod orso, he's much better @ coding then me.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
frank_freeman
Member
Join Date: Nov 2012
Old 08-13-2013 , 11:28   Re: [ReQ] First/Third Person Switching
Reply With Quote #7

Is it possible to have a plugin, which toggles between first person and 3rd person (no y/x rotation and a 64 unit distance)?
Would be really kewl
frank_freeman 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 21:09.


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