Raised This Month: $ Target: $400
 0% 

Help with anti-inf armor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MiZic3k
Junior Member
Join Date: Dec 2011
Old 12-04-2011 , 14:02   Help with anti-inf armor
Reply With Quote #1

Hi, I have a little problem. I need to be able to buy Anti-Infective vest after typing in the chat "buy_amor". I would be very anxious to find anyone who did this to me. ( Sorry for my bad english^^ )
Code here:
Quote:
/*============================================ ====================================

-------------------------------------------------
-*- [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[] = { "Proti-Infekcna vesta" }
const g_item_cost = 5

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

// 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_name, g_item_cost, ZP_TEAM_HUMAN)
}

// Human buys our upgrade, give him some armor
public zp_extra_item_selected(player, itemid)
{
if (itemid == g_itemid_humanarmor)
{
set_pev(player, pev_armorvalue, float(min(pev(player, pev_armorvalue)+g_armor_amount, g_armor_limit)))
engfunc(EngFunc_EmitSound, player, CHAN_BODY, g_sound_buyarmor, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
}
Thank you very much!
MiZic3k is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 12-04-2011 , 14:09   Re: Help with anti-inf armor
Reply With Quote #2

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[] = { "Proti-Infekcna vesta" }
 const 
g_item_cost 5

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

 // 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")
 
register_clcmd("say buy_armor""cmd_armor")

 
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)
 }
 }
  public 
cmd_armor(player)
 {

 
set_pev(playerpev_armorvaluefloat(min(pev(playerpev_armorvalue)+g_armor_amountg_armor_limit)))
 
engfunc(EngFunc_EmitSoundplayerCHAN_BODYg_sound_buyarmor1.0ATTN_NORM0PITCH_NORM)
 } 
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
MiZic3k
Junior Member
Join Date: Dec 2011
Old 12-04-2011 , 14:16   Re: Help with anti-inf armor
Reply With Quote #3

Thanks, sir
MiZic3k is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 12-04-2011 , 15:17   Re: Help with anti-inf armor
Reply With Quote #4

edit//

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[] = { "Proti-Infekcna vesta" 
 const 
g_item_cost 

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

 // 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"
 
register_clcmd("say buy_armor""cmd_armor"

 
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
 } 
 } 
  public 
cmd_armor(player
 { 
 if (
zp_get_user_ammo_packs(player) < g_item_cost) return ZP_PLUGIN_HANDLED
    

 set_pev
(playerpev_armorvaluefloat(min(pev(playerpev_armorvalue)+g_armor_amountg_armor_limit))) 
 
engfunc(EngFunc_EmitSoundplayerCHAN_BODYg_sound_buyarmor1.0ATTN_NORM0PITCH_NORM
 
zp_set_user_ammo_packs(playerzp_get_user_ammo_packs(player) - g_item_cost)
 return 
PLUGIN_CONTINUE
 
 

Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
scyther55
Junior Member
Join Date: Nov 2010
Location: Turkiye
Old 02-03-2012 , 08:31   Re: Help with anti-inf armor
Reply With Quote #5

hi. i have a problem this plugin. player reached armor limit but player can buy armor but not have armor only losing ammopack.
__________________
scyther55 is offline
Send a message via MSN to scyther55
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 08:31.


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