Raised This Month: $32 Target: $400
 8% 

Specific Armor for each class (ZP 5.0.8a)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
imnot1234
Junior Member
Join Date: Feb 2011
Old 09-14-2017 , 14:49   Specific Armor for each class (ZP 5.0.8a)
Reply With Quote #1

So I want 2 plugins that give armor, one for zombies/nemesis and the other for survivor compatible with Zombie Plague 5.0.8a mod (resources here)
1) Each zombie get armor. How does it works? Well, when you are turned into a zombie or infected you get a specific amount of armor (depending of your zombie class).
The plugin creates 2 fields in file zp_zombieclasses.ini for each class:
- ARMOR AMOUNT = [0 = no armor / 1 (or higher), the zombie gets that amount of armor / default = 0]
- ARMOR TYPE = [A = normal armor (kevlar) / AH = armor + helmet (kevlar+helmet) / default = A]. If is not possible of using letters just put 0/1.
There is a plugin that creates a field in classes.ini files. It adds class limit but you can take the field creation script from it (but as I said before only for zp_zombieclasses.ini)
This plugin should:
- not have the sound of buying armor
- not give armor when you are human/survivor
- remove the armor if you are turned into a human/survivor/nemesis (unless the nemesis gets armor from this plugin too). Just removes armor if the player is not the class from zp_zombieclasses.ini
Warning! Possible conflict with "zp50_human_armor" (the pugin is in ZP 5.0.8a). I mean that plugin has a protection system that armor should be reduced to 0 so after your armor is 0 your HP can be damaged (check "zp_human_armor_protect 1" cvar). This zombie armor should work like default armor on a classic server (you get damage to both HP and Armor).
Cvars:
- make a cvar so nemesis can get armor too, by a specific type: normal armor (kevlar) or armor + helmet (kevlar+helmet)
- make a cvar so you can specify the amount of armor for nemesis
2) Survivor gets armor. It just gives armor to survivor. The armor is removed if you are turned into a human/zombie/nemesis or if you survive the round as a survivor the armor is also removed.
Cvars:
- make a cvar so survivor gets armor, by a specific type: normal armor (kevlar) or armor + helmet (kevlar+helmet)
- make a cvar so you can specify the amount of armor for survivor
Warning! Possible conflict with "zp50_human_armor". That plugin may give a specific amount armor for humans so if you are turned into a survivor your armor is kept (check "zp_human_armor_default" cvar). This plugin you make should remove that kept armor and replace it with specified armor from this plugin.
imnot1234 is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 09-15-2017 , 18:22   Re: Specific Armor for each class (ZP 5.0.8a)
Reply With Quote #2

untested this is just for zombies:

PHP Code:
/*================================================================================
    
    ------------------------------
    -*- [ZP50] Zombie Armor 1.0 -*-
    ------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This addon allows add amount of  armor for zombie classes. 
    This plugin automatically adds to zp_zombieclasses.ini files a "ARMOR" field that you can change.
    
    ZP 5.0.5 or later required.
    
    ~~~~~~~~~~~~~
    - Changelog -
    ~~~~~~~~~~~~~
    
    * v1.0: (Sep 14, 2017)
       - First release
    
================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <amx_settings_api>
#include <zp50_class_zombie>

// Zombie Classes file
new const ZP_ZOMBIECLASSES_FILE[] = "zp_zombieclasses.ini"

#define ZOMBIE_DEFAULT_ARMOR 0.0

new Array:g_ZombieClassArmor

public plugin_init()
{
    
register_plugin("[ZP50] Zombie Armor""1.0""WiLS & JustGo")
    
    
g_ZombieClassArmor ArrayCreate(11)
    
    new 
indexcountreal_name[32]
    
    
count zp_class_zombie_get_count()
    for (
index 0index countindex++)
    {
        
zp_class_zombie_get_real_name(indexreal_namecharsmax(real_name))
        
        new 
Float:armor ZOMBIE_DEFAULT_ARMOR
        
        
if (!amx_load_setting_float(ZP_ZOMBIECLASSES_FILEreal_name"ARMOR"armor))
            
amx_save_setting_float(ZP_ZOMBIECLASSES_FILEreal_name"ARMOR"armor)
        
ArrayPushCell(g_ZombieClassArmorarmor)
    }
}

public 
zp_fw_core_infect_post(idattacker)
{
    new 
Float:armor ArrayGetCell(g_ZombieClassArmorzp_class_zombie_get_current(id))        
    
set_pev(idpev_armorvaluearmor)

__________________
JusTGo is offline
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 22:24.


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