Raised This Month: $12 Target: $400
 3% 

[HELP] Class camera


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuTo
Senior Member
Join Date: Mar 2010
Location: Brazil - SP
Old 10-13-2016 , 20:42   [HELP] Class camera
Reply With Quote #1

Hello, how do I get only the selected class has the privilege of camera 3 person?

client_putinserver is for everyone and I did not like this.

Can someone help me?

PHP Code:
/*================================================================================
    
    ----------------------------------
    -*- [ZP] Class: Human: CameraMan -*-
    ----------------------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <zp50_class_human>
#include <zp50_colorchat>

// Classic Human Attributes
new const humanclass1_name[] = "Human CameraMan"
new const humanclass1_info[] = "\y[\d3rd Person\y]"
new const humanclass1_models[][] = { "arctic" "guerilla" "leet" "terror" "gign" "gsg9" "sas" "urban" }
const 
humanclass1_health 100
const Float:humanclass1_speed 0.90
const Float:humanclass1_gravity 1.0

new g_HumanClassID

public plugin_precache()
{
    
register_plugin("[ZP] Class: Human: CameraMan"ZP_VERSION_STRING"BRAVOK")
    
    
g_HumanClassID zp_class_human_register(humanclass1_namehumanclass1_infohumanclass1_healthhumanclass1_speedhumanclass1_gravity)
    new 
index
    
for (index 0index sizeof humanclass1_modelsindex++)
        
zp_class_human_register_model(g_HumanClassIDhumanclass1_models[index])

    
precache_model("models/rpgrocket.mdl")
}

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

public 
client_putinserver(id)
{
        
set_view(idCAMERA_3RDPERSON)

code 3d person in class

PHP Code:
public client_putinserver(id)
{
        
set_view(idCAMERA_3RDPERSON)

__________________

Last edited by GuTo; 10-13-2016 at 20:43.
GuTo is offline
Send a message via Skype™ to GuTo
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-14-2016 , 03:50   Re: [HELP] Class camera
Reply With Quote #2

1) do it on Ham_Spawn, but add a delay to it and check if player is still alive after respawn.
2) Check which model the player has using cs_get_user_model
3) Set the view after the delay and if the user has the desired model.
4) register_plugin should happen in plugin_init(). Only thing that should be made in precache is precache_model
__________________

Last edited by Napoleon_be; 10-14-2016 at 03:51.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
GuTo
Senior Member
Join Date: Mar 2010
Location: Brazil - SP
Old 10-14-2016 , 14:13   Re: [HELP] Class camera
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
1) do it on Ham_Spawn, but add a delay to it and check if player is still alive after respawn.
2) Check which model the player has using cs_get_user_model
3) Set the view after the delay and if the user has the desired model.
4) register_plugin should happen in plugin_init(). Only thing that should be made in precache is precache_model

Hello all right? ... Help me? I'm not so good to do it
I am still newbie

Thank you
__________________
GuTo is offline
Send a message via Skype™ to GuTo
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-16-2016 , 15:56   Re: [HELP] Class camera
Reply With Quote #4

check out the zp50 include files you will find something to help you with.

im sure you will find something useful here...
PHP Code:
#if defined _zp50_class_human_included
  #endinput
#endif
#define _zp50_class_human_included

#include <zp50_core>
#include <zp50_class_human_const>

#if AMXX_VERSION_NUM >= 175
    #pragma reqlib zp50_class_human
    #if !defined AMXMODX_NOAUTOLOAD
        #pragma loadlib zp50_class_human
    #endif
#else
    #pragma library zp50_class_human
#endif


/**
 * Returns a player's current human class ID.
 *
 * @param id        Player index.
 * @return            Internal human class ID, or ZP_INVALID_HUMAN_CLASS if not yet chosen.
 */
native zp_class_human_get_current(id)

/**
 * Returns a player's next human class ID (for the next infection).
 *
 * @param id        Player index.
 * @return            Internal human class ID, or ZP_INVALID_HUMAN_CLASS if not yet chosen.
 */
native zp_class_human_get_next(id)

/**
 * Sets a player's next human class ID (for the next infection).
 *
 * @param id        Player index.
 * @param classid    A valid human class ID.
 * @return            True on success, false otherwise.
 */
native zp_class_human_set_next(idclassid)

/**
 * Registers a custom class which will be added to the human classes menu of ZP.
 *
 * Note: The returned human class ID can be later used to identify
 * the class when calling the zp_get_user_human_class() natives.
 *
 * @param name            Caption to display on the menu.
 * @param description    Brief description of the class.
 * @param health        Class health.
 * @param speed            Class maxspeed (can be a multiplier).
 * @param gravity        Class gravity multiplier.
 * @return                An internal human class ID, or ZP_INVALID_HUMAN_CLASS on failure.
 */
native zp_class_human_register(const name[], const description[], healthFloat:speedFloat:gravity)

/**
 * Registers a custom player model for a given human class.
 *
 * @param classid        A valid human class ID.
 * @param model            Player model's short name.
 * @return                True on success, false otherwise.
 */
native zp_class_human_register_model(classid, const model[])

/**
 * Returns a human class' ID.
 *
 * @param name        Class name to look for.
 * @return            Internal human class ID, or ZP_INVALID_HUMAN_CLASS if not found.
 */
native zp_class_human_get_id(const real_name[])

/**
 * Returns a human class' name.
 *
 * @param classid    A valid human class ID.
 * @param name        The buffer to store the string in.
 * @param len        Character size of the output buffer.
 * @return            True on success, false otherwise.
 */
native zp_class_human_get_name(classidname[], len)

/**
 * Returns a human class' real name (used when registering the class).
 *
 * @param classid    A valid human class ID.
 * @param name        The buffer to store the string in.
 * @param len        Character size of the output buffer.
 * @return            True on success, false otherwise.
 */
native zp_class_human_get_real_name(classidreal_name[], len)

/**
 * Returns a human class' description.
 *
 * @param classid        A valid human class ID.
 * @param description    The buffer to store the string in.
 * @param len            Character size of the output buffer.
 * @return                True on success, false otherwise.
 */
native zp_class_human_get_desc(classiddescription[], len)

/**
 * Returns number of registered human classes.
 *
 * @return            Human class count.
 */
native zp_class_human_get_count()

/**
 * Shows menu with available human classes to a player.
 *
 * @param id        Player index.
 */
native zp_class_human_show_menu(id)

/**
 * Appends text to a class being displayed on the human classes menu.
 * Use this on the class select pre forward.
 *
 * @param text        Additional text to display.
 */
native zp_class_human_menu_text_add(const text[])

/**
 * Called when determining whether a class should be available to a player.
 *
 * Possible return values are:
 *    - ZP_CLASS_AVAILABLE (show in menu, allow selection)
 *    - ZP_CLASS_NOT_AVAILABLE (show in menu, don't allow selection)
 *    - ZP_CLASS_DONT_SHOW (don't show in menu, don't allow selection)
 *
 * @param id            Player index.
 * @param classid        Internal human class ID.
 */
forward zp_fw_class_human_select_pre(idclassid
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
GuTo
Senior Member
Join Date: Mar 2010
Location: Brazil - SP
Old 10-17-2016 , 23:32   Re: [HELP] Class camera
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
check out the zp50 include files you will find something to help you with.

im sure you will find something useful here...
PHP Code:
#if defined _zp50_class_human_included
  #endinput
#endif
#define _zp50_class_human_included

#include <zp50_core>
#include <zp50_class_human_const>

#if AMXX_VERSION_NUM >= 175
    #pragma reqlib zp50_class_human
    #if !defined AMXMODX_NOAUTOLOAD
        #pragma loadlib zp50_class_human
    #endif
#else
    #pragma library zp50_class_human
#endif


/**
 * Returns a player's current human class ID.
 *
 * @param id        Player index.
 * @return            Internal human class ID, or ZP_INVALID_HUMAN_CLASS if not yet chosen.
 */
native zp_class_human_get_current(id)

/**
 * Returns a player's next human class ID (for the next infection).
 *
 * @param id        Player index.
 * @return            Internal human class ID, or ZP_INVALID_HUMAN_CLASS if not yet chosen.
 */
native zp_class_human_get_next(id)

/**
 * Sets a player's next human class ID (for the next infection).
 *
 * @param id        Player index.
 * @param classid    A valid human class ID.
 * @return            True on success, false otherwise.
 */
native zp_class_human_set_next(idclassid)

/**
 * Registers a custom class which will be added to the human classes menu of ZP.
 *
 * Note: The returned human class ID can be later used to identify
 * the class when calling the zp_get_user_human_class() natives.
 *
 * @param name            Caption to display on the menu.
 * @param description    Brief description of the class.
 * @param health        Class health.
 * @param speed            Class maxspeed (can be a multiplier).
 * @param gravity        Class gravity multiplier.
 * @return                An internal human class ID, or ZP_INVALID_HUMAN_CLASS on failure.
 */
native zp_class_human_register(const name[], const description[], healthFloat:speedFloat:gravity)

/**
 * Registers a custom player model for a given human class.
 *
 * @param classid        A valid human class ID.
 * @param model            Player model's short name.
 * @return                True on success, false otherwise.
 */
native zp_class_human_register_model(classid, const model[])

/**
 * Returns a human class' ID.
 *
 * @param name        Class name to look for.
 * @return            Internal human class ID, or ZP_INVALID_HUMAN_CLASS if not found.
 */
native zp_class_human_get_id(const real_name[])

/**
 * Returns a human class' name.
 *
 * @param classid    A valid human class ID.
 * @param name        The buffer to store the string in.
 * @param len        Character size of the output buffer.
 * @return            True on success, false otherwise.
 */
native zp_class_human_get_name(classidname[], len)

/**
 * Returns a human class' real name (used when registering the class).
 *
 * @param classid    A valid human class ID.
 * @param name        The buffer to store the string in.
 * @param len        Character size of the output buffer.
 * @return            True on success, false otherwise.
 */
native zp_class_human_get_real_name(classidreal_name[], len)

/**
 * Returns a human class' description.
 *
 * @param classid        A valid human class ID.
 * @param description    The buffer to store the string in.
 * @param len            Character size of the output buffer.
 * @return                True on success, false otherwise.
 */
native zp_class_human_get_desc(classiddescription[], len)

/**
 * Returns number of registered human classes.
 *
 * @return            Human class count.
 */
native zp_class_human_get_count()

/**
 * Shows menu with available human classes to a player.
 *
 * @param id        Player index.
 */
native zp_class_human_show_menu(id)

/**
 * Appends text to a class being displayed on the human classes menu.
 * Use this on the class select pre forward.
 *
 * @param text        Additional text to display.
 */
native zp_class_human_menu_text_add(const text[])

/**
 * Called when determining whether a class should be available to a player.
 *
 * Possible return values are:
 *    - ZP_CLASS_AVAILABLE (show in menu, allow selection)
 *    - ZP_CLASS_NOT_AVAILABLE (show in menu, don't allow selection)
 *    - ZP_CLASS_DONT_SHOW (don't show in menu, don't allow selection)
 *
 * @param id            Player index.
 * @param classid        Internal human class ID.
 */
forward zp_fw_class_human_select_pre(idclassid


I I've used almost all sos and was not very successful ;/
Some work only que for All Server
__________________
GuTo is offline
Send a message via Skype™ to GuTo
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-18-2016 , 11:22   Re: [HELP] Class camera
Reply With Quote #6

which class do you want to be able to get 3rd person?
Also, do you want them to automaticly get it or do you want them to choose for it? (By a menu or something simular)
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
GuTo
Senior Member
Join Date: Mar 2010
Location: Brazil - SP
Old 10-18-2016 , 16:48   Re: [HELP] Class camera
Reply With Quote #7

Quote:
Originally Posted by Napoleon_be View Post
which class do you want to be able to get 3rd person?
Also, do you want them to automaticly get it or do you want them to choose for it? (By a menu or something simular)


What must IT automatic Come When moving human class there IS NO More and More in 3 person

sorry my bad English
__________________
GuTo is offline
Send a message via Skype™ to GuTo
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 10-18-2016 , 17:46   Re: [HELP] Class camera
Reply With Quote #8

You will need to use boolean variables, search on internet.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-19-2016 , 06:31   Re: [HELP] Class camera
Reply With Quote #9

If someone can provide me some USEFULL info, i might get this fixed. But i can't understand what he's trying to say.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
GuTo
Senior Member
Join Date: Mar 2010
Location: Brazil - SP
Old 10-19-2016 , 22:46   Re: [HELP] Class camera
Reply With Quote #10

Quote:
Originally Posted by Napoleon_be View Post
If someone can provide me some USEFULL info, i might get this fixed. But i can't understand what he's trying to say.
sorry ;/ my bad English

So... I need to be automatic when the class is selected, and when change should resume normal camera
__________________
GuTo is offline
Send a message via Skype™ to GuTo
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 19:03.


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