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
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 08-08-2020 , 16:32   Re: Check if user is alive or is dead
Reply With Quote #3

Quote:
Originally Posted by Barlap View Post
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
}
Try this
PHP Code:
public client_death(g_victim)
{
    if (
is_user_alive(g_victim))
        return 
PLUGIN_HANDLED;
    
    
set_view(g_victimCAMERA_3RDPERSON)
    
    return 
PLUGIN_CONTINUE;

Supremache is offline
 



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