Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP] Zombie XP - Human Classes - Leveling Up - v0.8 Update


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
redomin8
Member
Join Date: Feb 2005
Old 01-19-2009 , 14:18   Re: [ZP] Zombie XP - Human Classes & Leveling Up - v0.7b
Reply With Quote #11

No but close. Open up one of the current human classes, and take a look: const hclass_level = 6 // level required to use
I provided all the SMAs for the human example classes. They're just like zombies but they register human instead.

For making humans classes, on zp_user_humanized_post(id) we call zp_round_started_human(id) (as long as we are not survivor). Here, take a look at an excerpt of an example.
------------------------------------------------------------------------
PHP Code:
/*================================================================================
Human Class
================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <zombiexp>

// Human Attributes
new const hclass_name[] = { "Very Gravity" // name
new const hclass_info[] = { "AK-47 and low gravity" // description
new const hclass_model[] = { "" // model
new const hclass_weapons[] = { WEAPON_AK47WEAPON_GLOCK18 // weapons
const hclass_health 100 // health
const hclass_speed 240 // speed
const Float:hclass_gravity 0.75 // gravity
const hclass_level // level required to use

// Class IDs
new g_hclassid

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
    new 
registerText[32]
    
formatexregisterTextsizeof registerText 1"[ZPXP] %s human"hclass_name)
    
    
register_plugin(registerText"1.0""Example")
    
    
// Register the new class and store ID for reference
    
g_hclassid zpxp_register_human_class(hclass_namehclass_infohclass_modelhclass_weaponshclass_healthhclass_speedhclass_gravityhclass_level)
    
    if(
g_hclassid == -1)
    {
        
server_print("[ZPXP] You have not properly setup your Zombie XP Mod.");
    }
}

// User Infected forward
public zp_user_infected_post(idinfector)
{
    
// Check if the infected player is using our custom zombie class
    
if (zp_get_user_human_class(id) != g_hclassid) return;
    
    
// Undo any settings we have saved here
    
}

public 
zp_user_humanized_post(id)
{
    
// Check if the infected player is using our custom zombie class
    
if (zp_get_user_human_class(id) != g_hclassid) return;

    
// User turned human
    
if (zp_get_user_survivor(id) == 1)
    {
        
// He's survivor, remove any changes made in the plugin
        
zp_user_infected_post(id0)
    } else {
        
zp_round_started_human(id)
    }
}

//This is a forward from zpxp, as opposed to ZPs round_start (which is when infection begins) this is the true beginning of the round
public zp_round_started_human(id)
{
    if (
zp_get_user_human_class(id) != g_hclassid) return;
    
// Set our human's powers!
        

__________________
"Your momma's so dumb she required a cvar to turn the tv on." - Inspired by Speed!

Last edited by redomin8; 01-19-2009 at 18:38.
redomin8 is offline
Send a message via AIM to redomin8
 



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 16:24.


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