Solved3rd person on/off code

Posts 16 of 6 · Page 1 of 1
3rd person on/off code
I started making a code to turn 3rd person on/off, kind of like the ufo code, heres what I got so far

[HTML]
do3rd()
{
self endon ( "disconnect" );

self notifyOnPlayerCommand("5", "+actionslot 2");

for( ;; )
{
self waittill("5");
setDvar("camera_thirdperson", 1);
setDvar("camera_thirdPersonCrosshairOffset", 0);
self thread maps\mp\gametypes\_hud_message::hintMessage( "^1 Press 5 to exit 3rd person." );





}
}
[/HTML]

Can anyone tell me the code to return to normal view ?
That would be
Code:
setDvar("camera_thirdperson", 0);
i guess. I have no idea if it works, that's just a guess. Or maybe
Code:
setDvar("camera_firstperson", 1);
Yep got it to work, thanks alot mate (:
Extracted from _dev.gsc:

Code:
thirdPersonToggle()
{
	self endon ( "death" );
	self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );
	
	thirdPersonElem = self createFontString( "default", 1.5 );
	thirdPersonElem setPoint( "TOPRIGHT", "TOPRIGHT", 0, 72 + 260 );
	thirdPersonElem setText( "3rd Person: " + getDvarInt( "camera_thirdPerson" ) + "  [{+actionslot 2}]" );
	self thread destroyOnDeath( thirdPersonElem );
	
	for ( ;; )
	{
		self waittill( "dpad_down" );

		setDvar( "camera_thirdPerson", !getDvarInt( "camera_thirdPerson" ) );
		
		thirdPersonElem setText( "3rd Person: " + getDvarInt( "camera_thirdPerson" ) + "  [{+actionslot 2}]" );
	}
}
Posts 16 of 6 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?