Raised This Month: $ Target: $400
 0% 

Solved Check if user is alive or is dead


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Barlap
Senior Member
Join Date: Apr 2016
Location: Romania
Old 08-08-2020 , 15:06   Check if user is alive or is dead
Reply With Quote #1

Hello guys
I have this camera plugin and i need help please
I want the plugin to change automatically to 3rd person when you die and back to first person when you are alive.
Can somebody help me with some code?
HTML Code:
#include <amxmodx>
#include <engine>
#include <amxmisc>

public plugin_init()
{
    register_plugin("Camera Changer", "1.0", "XunTric")
    register_menucmd(register_menuid("Choose Camera View"), 1023, "setview") 

    register_clcmd("say /cam", "chooseview")
    register_clcmd("say_team /cam", "chooseview")    
}

public client_putinserver( id )
{
         set_view(id, CAMERA_3RDPERSON)
         return PLUGIN_HANDLED
}

public plugin_modules()
{
    require_module("engine")
}

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

public chooseview(id)
{
    new menu[192] 
    new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3 
    format(menu, 191, "Choose Camera View^n^n1. 3rd Person View^n2. Upside View^n3. Normall View^n^n0. Exit") 
    show_menu(id, keys, menu)      
    return PLUGIN_CONTINUE
}

public setview(id, key, menu)
{
    if(key == 0) {
         set_view(id, CAMERA_3RDPERSON)
         return PLUGIN_HANDLED
    }

    if(key == 1) {
         set_view(id, CAMERA_TOPDOWN)
         return PLUGIN_HANDLED
    }

    if(key == 2) {
         set_view(id, CAMERA_NONE)
         return PLUGIN_HANDLED
    }

    else {
         return PLUGIN_HANDLED
    }

    return PLUGIN_HANDLED
}

Last edited by Barlap; 08-09-2020 at 19:07.
Barlap is offline
Send a message via ICQ to Barlap Send a message via Skype™ to Barlap
 



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 13:53.


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