Raised This Month: $404 Target: $400
 101% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
redomin8
Member
Join Date: Feb 2005
Old 01-18-2009 , 23:13   [ZP] Zombie XP - Human Classes - Leveling Up - v0.8 Update
Reply With Quote #1

I'm not going to be on the scene so anyone feel free to continue this. Discontinued 2-6-09.
Zombie XP

Zombie XP is a plugin which runs in UNISON with zombie plague.
It does not require editing the zombie plague file in any way.

This is a stable and safe plugin, but like all plugins, if there is a problem please post about it here, and I will help solve it.
  • (Be sure and update ZP Bank - with Autosave if you use this plugin)
  • If you install this, leave a comment with your server's IP address. I'll come check it out

Human Classes Only:
Update: Many people asked for JUST a human classes plugin. Just set the following CVARs at the end of your zombieplague.cfg (amxmodx/configs/zombieplague.cfg)
PHP Code:
zp_xp_removexp 1    //disables XP
zp_xp_removeweapons 1    //removes custom class weapons and enables CSDM
zp_xp_removezombie 2    //removes custom zombie classes 
Then just press J in game to show the human class menu.

Credits:
First and foremost, I would like to say thanks to the following people
  • MeRcyLeZZ coded a genius plugin, and I learned
    from his talent and even used some stock functions
  • Also, I'd very much like to thank G-Dog for all the help with creating
    ZP Bank, I used his code to learn nvault.
  • Thanks to AssKicR and xeroblood for making ExplodeString.

    Good job guys!

Features:
  • Gaining levels unlocks stronger classes for both humans and zombies.
  • Human Classes - by default the CSDM weapon menu is disabled. As you level up, you can choose stronger human classes with better weapons.
  • Zombie Classes - The same as always (but found in Zombie XP's menu).
  • Saves Levels automatically.
  • Saves human and zombie class selection.

Additional Information
  • To view the Zombie XP menu type xpmenu. If you leave "#define ZP_BINDMENU" uncommented (Uncommented by default), you can also press "J" to show the Zombie XP menu.
  • You can level up, and each level costs more money than the last. This is a great plugin for servers where people spam infections grenades because there is no other reason to save their money.
  • Basic addon zombies have been provided for Zombie XP, and I can't wait to see what the community comes up with. No modified zombie classes have been provided without explicit permission from the owners (currently there are none attached).

How to Install
  • Just put zombie_xp.amxx anywhere after zombie_plague40.amxx in your plugins_zplague.ini. Then add the supporting zombies. Important note: You must remove/comment out all other zombies which do not support zombie xp. zombie plague uses indexes for zombies, and by adding zombies that do not support zombie xp, all classes' index will be incorrect.
  • The only exception to having non-Zombie XP zombies is to set cvar zp_xp_removezombie to 1 or 2, but doing so disables custom zombies (only humans will be listed, and zombies can be chosen from zombie plague's menu
  • Make sure human classes come FIRST, before ANY zombie classes

How to Modify Zombies for Zombie XP
  • It's really easy to convert zombie_plague zombies to a format required by zombie xp. Add "#include <zombiexp>", and just replace zp_register_zombie_class with zpxp_register_zombie_class, adding the required level at the end.
  • Example:
    PHP Code:
    zp_register_zombie_class(nameinfomodelclawmodelhealthspeedgravityknockback
  • Becomes:
    PHP Code:
    const hclass_level // level required to use

    zpxp_register_zombie_class(nameinfomodelclawmodelhealthspeedgravityknockbacklevel
  • Humans use a similar function
    PHP Code:
    //Note: zclass_clawmodel becomes hclass_weapons
    const hclass_level // level required to use
    new const hclass_weapons[] = { WEAPON_AK47WEAPON_GLOCK18 // weapons 

    g_hclassid zpxp_register_human_class(hclass_namehclass_infohclass_modelhclass_weaponshclass_healthhclass_speedhclass_gravityhclass_level

Some screenshots
Customization
  • zp_xp_welcomemsg 0/1 - Shows welcome message
  • zp_xp_removeweapons 0/1 - [0] Custom class guns, or [1] CSDM default menu
  • zp_xp_removexp 1/0 - Allows selection of any human/zombie class without checking for XP requirements
  • zp_xp_removezombie 0/1/2 - [0] Regular Zombie XP and classes. [1] Hide Zombie XP zombies and re-enable Zombie Plague's zombie list. [2] Same as setting with 1 (hide Zombie XP zombie menu + reenable Zombie Plagues menu) AND prevent Zombie XP classes from being registered with zombie plague. This requires a restart.

Code Notes
  • There is a clearly marked section of the code labeled "Editable Section follows", where you can edit some settings in the plugin.
  • #define TRIGGER_ZP_ITEM - Default: enabled - Uncomment to have an item added to zp's extra menu
  • #define TRIGGER_SAYMENU - Default: enabled - Uncomment to use say commands like "xp", "levels", "class", etc
  • #define ZP_BANK_AUTOSAVE - Default: disabled - Uncomment if you have redomin8's [ZP] Bank - With Autosave installed (fixes spending spree bug)
  • #define ZP_ALIGN_TEXT - Default: disabled - Uncomment to allow experimental menu alignment
  • #define ZP_GAMERUINER - Default: disabled - Uncomment to give levels to people
  • #define ZP_BINDMENU "j" - Default: enabled - Uncomment to automatically bind a letter to show our menu

Notes
  • To change the cost multiplier for leveling up (default is level*15 = cost) use zp_xp_costscale #. (Level 1 costs 15, level 2 costs 30, etc)
  • (ONLY IN BETA) To change someone's level, use zp_xp_set_level name #.
  • Be sure to comment out other zombies that do not support zombie xp, failure to do so will create unpredictable results (Unless you set cvar zp_xp_removezombie to 1 or 2)
  • Keep human names shorter than 32 chars (this is for a clean GUI)
  • If anyone can help with ZP_ALIGN_TEXT, that would be wonderful!
  • Be sure and update ZP Bank - with Autosave if you use this plugin
Attached Files
File Type: zip Zombie XP v0.8.zip (34.6 KB, 19254 views)
__________________
"Your momma's so dumb she required a cvar to turn the tv on." - Inspired by Speed!

Last edited by redomin8; 02-07-2009 at 03:03.
redomin8 is offline
Send a message via AIM to redomin8
redomin8
Member
Join Date: Feb 2005
Old 01-18-2009 , 23:21   Re: [ZP] Zombie XP - Human Classes & Leveling Up
Reply With Quote #2

This is only a beta, and I would love feedback and any errors people get!
__________________
"Your momma's so dumb she required a cvar to turn the tv on." - Inspired by Speed!
redomin8 is offline
Send a message via AIM to redomin8
Speed!
BANNED
Join Date: Jan 2009
Old 01-18-2009 , 23:25   Re: [ZP] Zombie XP - Human Classes & Leveling Up - v0.7
Reply With Quote #3

i havent tried it (and i wont, not because i dont like it, if not because in my server i have something like this, but integrated on the own ZP plugins.) but i would wonder to know if i know you, because your name seems to be a bit known....
sorry for the offtopic, so i will tell you something about this
good job, i think this might be some buggy with actual zombie plague, with nemesis getting the hp value etc but dont know, i havent tried this.
somehow, you always do what i do O.o
when i did first the bank with autoupdate, 10 days later i saw it here from you LOL, now this

Last edited by Speed!; 01-18-2009 at 23:28.
Speed! is offline
redomin8
Member
Join Date: Feb 2005
Old 01-18-2009 , 23:34   Re: [ZP] Zombie XP - Human Classes & Leveling Up - v0.7
Reply With Quote #4

Thanks speed!
I did test it will all modes of zombie plague (IE. when zplague creates a survivor, all settings are reset for survivor mode, etc), and everything seems to be in order.
__________________
"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:49. Reason: crash was being caused from a different plugin lol
redomin8 is offline
Send a message via AIM to redomin8
Speed!
BANNED
Join Date: Jan 2009
Old 01-18-2009 , 23:37   Re: [ZP] Zombie XP - Human Classes & Leveling Up - v0.7
Reply With Quote #5

oh, crashing that oftent is very bad O.o, i really dunno, i must realize that in some plugins i made there have appeared some annoyng bugs, and error, where there was no error at programming. it is probably pawn compiler or amxmodx errors, or maybe hlds dunno

im a bit interesting in knowing what does "better weapons" mean at all

PD: are you from latin-america?

Last edited by Speed!; 01-18-2009 at 23:43.
Speed! is offline
redomin8
Member
Join Date: Feb 2005
Old 01-18-2009 , 23:52   Re: [ZP] Zombie XP - Human Classes & Leveling Up - v0.7a
Reply With Quote #6

Nah, I'm from Los Angeles, CA.
What I mean by better weapons, is the beginner level human classes start with, say AK-47 and a basic secondary, or a Colt, etc.

As you level up, classes start to get stronger (higher health, faster speeds, lower gravity) and they also give you more weapons (grenades, etc).

One of the neatest things, is that you can easily give multiple primary weapons to a stronger human class just by adding its enum. These are all found in zombiexp.inc, but here's a copy-paste.

PHP Code:
enum
{
    
WEAPON_GALIL 1,
    
WEAPON_FAMAS,
    
WEAPON_M4A1,
    
WEAPON_AK47,
    
WEAPON_SG552,
    
WEAPON_AUG,
    
WEAPON_SCOUT,
    
WEAPON_M3,
    
WEAPON_XM1040,
    
WEAPON_TMP,
    
WEAPON_MAC10,
    
WEAPON_UMP45,
    
WEAPON_MP5NAVY,
    
WEAPON_P90,
    
WEAPON_GLOCK18,
    
WEAPON_USP,
    
WEAPON_P228,
    
WEAPON_DEAGLE,
    
WEAPON_FIVESEVEN,
    
WEAPON_ELITE,
    
WEAPON_HEGRENADE,
    
WEAPON_FLASHBANG,
    
WEAPON_SMOKEGRENADE

By simply changing:
PHP Code:
new const hclass_weapons[] = { WEAPON_MP5NAVYWEAPON_P228 // weapons chosen 
To:
PHP Code:
new const hclass_weapons[] = { WEAPON_AK47WEAPON_MP5NAVYWEAPON_P228 // weapons chosen 
You just gave them two primary weapons. The same is true for WEAPON_HEGRENADE, just add a comma at the end and paste that.
__________________
"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:39.
redomin8 is offline
Send a message via AIM to redomin8
Speed!
BANNED
Join Date: Jan 2009
Old 01-19-2009 , 00:02   Re: [ZP] Zombie XP - Human Classes & Leveling Up - v0.7b
Reply With Quote #7

nice
i though that this was something like what i did in mi server, but it has nothing to do LOL
it seems to be a great plugin since you can add everithing in a easy way, via natives
i would +karma you but i did already in another post, and it wont let me LOL
allthough i am not using this plugin, but im glad of your effor

edit: i though you were from latin america because of the time you post plugins LOL
Speed! is offline
redomin8
Member
Join Date: Feb 2005
Old 01-19-2009 , 00:16   Re: [ZP] Zombie XP - Human Classes & Leveling Up - v0.7b
Reply With Quote #8

Ya being a programmer and having insomnia go hand in hand
__________________
"Your momma's so dumb she required a cvar to turn the tv on." - Inspired by Speed!
redomin8 is offline
Send a message via AIM to redomin8
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-19-2009 , 12:29   Re: [ZP] Zombie XP - Human Classes & Leveling Up - v0.7b
Reply With Quote #9

is all you have to do but
zpxp_register_zombie_class(name, info, model, clawmodel, health, speed, gravity, knockback, level)

on the part where it defines these
new const
new
new Float

is that where you define the level and is it
PHP Code:
new const level[] = { "15" // level 
?
__________________
Doc-Holiday is offline
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 #10

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
Reply


Thread Tools
Display Modes

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 11:10.


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