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

API Scripting Help Anti-Infection Armor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
firevol
Junior Member
Join Date: Jun 2011
Old 10-07-2011 , 18:44   Anti-Infection Armor
Reply With Quote #1

Welcome,
How to fix a limit when the armor to ammo packs do not take.
And chatting wrote "Maximum Armor"
and buy "you buy armor"


PHP Code:
/*================================================================================
    
    -------------------------------------------------
    -*- [ZP] Extra Item: Anti-Infection Armor 1.0 -*-
    -------------------------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This item gives humans some armor that offers protection
    against zombie injuries.
    
================================================================================*/

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

/*================================================================================
 [Plugin Customization]
=================================================================================*/

new const g_item_name[] = { "Anti-Infection Armor" }
const 
g_item_cost 5

new const g_sound_buyarmor[] = { "items/tr_kevlar.wav" }
const 
g_armor_amount 100
const g_armor_limit 200

/*============================================================================*/

// Item IDs
new g_itemid_humanarmor

public plugin_precache()
{
    
precache_sound(g_sound_buyarmor)
}

public 
plugin_init()
{
    
register_plugin("[ZP] Extra: Anti-Infection Armor""1.0""MeRcyLeZZ")
    
    
g_itemid_humanarmor zp_register_extra_item(g_item_nameg_item_costZP_TEAM_HUMAN)
}

// Human buys our upgrade, give him some armor
public zp_extra_item_selected(playeritemid)
{
    if (
itemid == g_itemid_humanarmor)
    {
        
set_pev(playerpev_armorvaluefloat(min(pev(playerpev_armorvalue)+g_armor_amountg_armor_limit)))
        
engfunc(EngFunc_EmitSoundplayerCHAN_BODYg_sound_buyarmor1.0ATTN_NORM0PITCH_NORM)
    }

firevol is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 10-07-2011 , 21:53   Re: Anti-Infection Armor
Reply With Quote #2

PHP Code:
// Human buys our upgrade, give him some armor 
public zp_extra_item_selected(playeritemid

    if (
itemid == g_itemid_humanarmor
    { 
        
set_pev(playerpev_armorvaluefloat(min(pev(playerpev_armorvalue)+g_armor_amountg_armor_limit))) 
        
engfunc(EngFunc_EmitSoundplayerCHAN_BODYg_sound_buyarmor1.0ATTN_NORM0PITCH_NORM
        
client_print(playerprint_center"You Bought %s armor"get_pcvar_num(g_armor_amount))
    } 

try that .
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.

Last edited by JoKeR LauGh; 10-07-2011 at 23:48.
JoKeR LauGh is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 10-08-2011 , 03:03   Re: Anti-Infection Armor
Reply With Quote #3

Please test, it should work fine on ZP4.3
Attached Files
File Type: sma Get Plugin or Get Source (ZP_Extra_ArmorChat.sma - 1247 views - 2.1 KB)
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 10-08-2011 , 07:17   Re: Anti-Infection Armor
Reply With Quote #4

works fine
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 10-08-2011 , 10:19   Re: Anti-Infection Armor
Reply With Quote #5

Quote:
Originally Posted by JoKeR LauGh View Post
works fine
Pizza or burger please...
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
firevol
Junior Member
Join Date: Jun 2011
Old 10-08-2011 , 11:31   Re: Anti-Infection Armor
Reply With Quote #6

Quote:
Originally Posted by yokomo View Post
Please test, it should work fine on ZP4.3
thanks
firevol is offline
firevol
Junior Member
Join Date: Jun 2011
Old 10-08-2011 , 12:22   Re: Anti-Infection Armor
Reply With Quote #7

How do [ZP] prefix as a standard version of the writing in chat zombie plague 5.0.5
firevol is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 10-08-2011 , 13:09   Re: Anti-Infection Armor
Reply With Quote #8

Quote:
Originally Posted by firevol View Post
How do [ZP] prefix as a standard version of the writing in chat zombie plague 5.0.5
You need to use color chat native, ask someone to update it. I don't like coloful & fancy gameplay.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 10-09-2011 , 07:29   Re: Anti-Infection Armor
Reply With Quote #9

:burger:

:pizza:



colorful will make everyone happy ^_^
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.

Last edited by JoKeR LauGh; 10-09-2011 at 07:41.
JoKeR LauGh is offline
unscarred
Member
Join Date: Dec 2009
Location: cs 1.6
Old 09-15-2012 , 06:46   Re: Anti-Infection Armor
Reply With Quote #10

Quote:
Originally Posted by yokomo View Post
Please test, it should work fine on ZP4.3
someone can add function
if you buy more than 3 times, item won't show more for you
thanks

Last edited by unscarred; 09-26-2012 at 17:18.
unscarred 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 17:08.


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