AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help - 3rd Person View (https://forums.alliedmods.net/showthread.php?t=196027)

PandaDnB 09-14-2012 13:45

Help - 3rd Person View
 
1 Attachment(s)
Hello, i have this 3rd person view plugin but i want it to turn off and turn on with the same command(turned off by default). I'm attaching it.

Torge 09-14-2012 13:58

Re: Help - 3rd Person View
 
I think that can't work with 2 same commands.

PandaDnB 09-14-2012 14:01

Re: Help - 3rd Person View
 
I've seen servers that have it. Mine plugin wont work but i think that with some sort of check (if..) will work somehow.

ConnorMcLeod 09-14-2012 14:19

Re: Help - 3rd Person View
 
PHP Code:

#include <amxmodx>
#include <engine>

new g_bView33 ]

public 
plugin_init()
{
    
register_plugin("Camera""1.0""PandaDNB")
    
register_clcmd("say /cam""ClCmd_Cam")
}

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

public 
client_putinserver(id)
{
    
g_bView[id] = false
}

public 
ClCmd_Cam(id)
{
    
set_view
    
(
        
id
        (
g_bView[id] = !g_bView[id]) ? CAMERA_3RDPERSON CAMERA_NONE
    
)
    return 
PLUGIN_HANDLED



PandaDnB 09-14-2012 15:21

Re: Help - 3rd Person View
 
1 Attachment(s)
Doesn't compile :(

OnePL 09-14-2012 16:08

Re: Help - 3rd Person View
 
PHP Code:

#include <amxmodx>
#include <engine>

new bool:view[33] = false

public plugin_init() {
    
register_plugin("Camera""1.0""OnePL")

    
register_clcmd("say /cam""Camera")
}

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

public 
Camera(id) {
    if(
view[id]) {
        
view[id] = false
        set_view
(idCAMERA_NONE)
    } else {
        
view[id] = true
        set_view
(idCAMERA_3RDPERSON)
    }
    
client_print(idprint_chat"Camera 3rd person: %s"view[id]? "on" "off")
    return 
PLUGIN_HANDLED



PandaDnB 09-14-2012 16:46

Re: Help - 3rd Person View
 
Thank you !

meTaLiCroSS 09-14-2012 20:34

Re: Help - 3rd Person View
 
Quote:

Originally Posted by PandaDnB (Post 1799220)
Doesn't compile :(

Delete the comma after CAMERA_NONE, that's all lol

ConnorMcLeod 09-15-2012 05:25

Re: Help - 3rd Person View
 
Quote:

Originally Posted by meTaLiCroSS (Post 1799436)
Delete the comma after CAMERA_NONE, that's all lol

Yes, fixed.


All times are GMT -4. The time now is 08:14.

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