Raised This Month: $51 Target: $400
 12% 

Max Player Armor


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 04-10-2021 , 14:54   Max Player Armor
Reply With Quote #1

Hello, i wanted to ask for help, i dont know how to do that player cant go bigger than 200 armor , and in one round cant buy more than 600... I have the last thing i mentioned in my script but the first one i dont know how to do it without making that ItemCount trigger...
PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <zombieplague> 
#include <cc>

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

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

new g_ItemCount[33]
new 
g_itemid_armor 

public plugin_precache() 

    
precache_sound(g_sound_buyarmor


public 
plugin_init() 

    
register_plugin("[ZP] Extra: Anti-Infection Armor""1.0""MeRcyLeZZ"
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
        
    
g_itemid_armor zp_register_extra_item(g_item_nameg_item_costZP_TEAM_HUMAN
}

public 
event_round_start(id)
{
    
arrayset(g_ItemCount0sizeof g_ItemCount)
    
}

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

    if (
itemid == g_itemid_armor
    {    
        if(
g_ItemCount[player] >= 6)
        {
            
client_print_color(playerprint_chat"^4[^1ZP^4] ^1Max armor limit to buy in one round is^4 600^1!")
            
zp_set_user_ammo_packs(playerzp_get_user_ammo_packs(player) + g_item_cost)
        }
        else
        {
            
set_pev(playerpev_armorvaluefloat(min(pev(playerpev_armorvalue)+g_armor_amountg_armor_limit))) 
            
engfunc(EngFunc_EmitSoundplayerCHAN_BODYg_sound_buyarmor1.0ATTN_NORM0PITCH_NORM
            
            
g_ItemCount[player] ++
        }
    } 

HowToRuski is offline
 



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 02:39.


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