AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ZP] Extra: Human Armor (https://forums.alliedmods.net/showthread.php?t=173366)

MiZic3k 12-04-2011 06:13

[ZP] Extra: Human Armor
 
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! :)

Pelita Jaya F.C 12-07-2011 12:10

Re: [ZP] Extra: Human Armor
 
Code:
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) }

->

Code:
public plugin_init() { register_plugin("[ZP] Extra: Anti-Infection Armor", "1.0", "MeRcyLeZZ") register_clcmd("say buy_armor", "zp_extra_item_selected") g_itemid_humanarmor = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN) }

Bos93 12-07-2011 14:43

Re: [ZP] Extra: Human Armor
 
http://forums.alliedmods.net/showthread.php?t=173406 omg

Pelita Jaya F.C 12-07-2011 22:37

Re: [ZP] Extra: Human Armor
 
so?


All times are GMT -4. The time now is 08:31.

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