[ZP] Buy HP!

Avatar utilizator
admin
admin
Reactions:
Mesaje: 3834
Registered for: 1 year 9 months
1
Last active: -
Localitate: România
Mood:
Gender:
Contact:

[ZP] Buy HP!

Mesaj de Diliul »

Descriere: Viata pentru human cu limita de doua ori pe runda, daca ati luat deja de doua ori pe runda nu o sa mai pierdeti ammo.

Descarcare:

Cod: Selectaţi tot

#include <amxmodx>
#include <fun>
#include <zombieplague>

new g_ItemID
new HpAmount

#define itemcost 20

new itemname[] = "Buy 200 HP!"

new g_Limit[33]
new g_iMaxPlayers

public plugin_init()
{
    register_plugin("Buy HP", "1.0" , "" )
    HpAmount = register_cvar("zp_buyhp_amount", "200")

    g_ItemID = zp_register_extra_item(itemname, itemcost, ZP_TEAM_HUMAN)

    register_event("HLTV", "event_new_round", "a", "1=0", "2=0") 
    g_iMaxPlayers = get_maxplayers()
}

public event_new_round()
{
    for(new id = 1; id <= g_iMaxPlayers; id++)
    {
        g_Limit[id] = 0
    }
}

public zp_extra_item_selected(id, item)
{
    if(!is_user_alive(id))
    return PLUGIN_HANDLED

    if(item == g_ItemID)
    {
        if(g_Limit[id] >= 2)
        {
            client_print(id, print_chat, "[ZP] You reached the limit of buying HP")
            return ZP_PLUGIN_HANDLED
        }
        set_user_health(id, get_user_health(id) + get_pcvar_num(HpAmount))
        client_print(id, print_chat, "[ZP] You bought HP!")
        g_Limit[id]++
    }
    return PLUGIN_HANDLED
} 
Nume: Health for Human
Versiune: 1.0
Link oficial: cspower / thexforce

Instalare:
1. Fisierul zp_extra_hphuman.sma il puneti in addons/amxmodx/scripting
2. Fisierul zp_extra_hphuman.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Cod: Selectaţi tot

zp_extra_hphuman.amxx
4. Alti pasi necesari....

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):

Cod: Selectaţi tot

zp_buyhp_amount - cat hp sa fie adaugat
in acest cod

Cod: Selectaţi tot

public zp_extra_item_selected(id, item)
{
    if(!is_user_alive(id))
    return PLUGIN_HANDLED

    if(item == g_ItemID)
    {
        if(g_Limit[id] >= 2)
        {
            client_print(id, print_chat, "[ZP] You reached the limit of buying HP")
            return ZP_PLUGIN_HANDLED
        }
        set_user_health(id, get_user_health(id) + get_pcvar_num(HpAmount))
        client_print(id, print_chat, "[ZP] You bought HP!")
        g_Limit[id]++
    }
    return PLUGIN_HANDLED
}
aveti aici codul unde va arata de cate ori poate cumpara utilizatorul

Cod: Selectaţi tot

        if(g_Limit[id] >= 2)
        {
            client_print(id, print_chat, "[ZP] You reached the limit of buying HP")
            return ZP_PLUGIN_HANDLED
        }
mai precis aici:

Cod: Selectaţi tot

if(g_Limit[id] >= 2)
schimbati 2 cu orice numar credeti ca vreti sa fie limita pe runda.
Imagini: -
━━━━ 『 SEMNĂTURA 』 ━━━━
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✦ FORUM.DILIUL.RO ✦
Digital Community • Resurse • Tutoriale
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ RADIO MYNELE LIVE ◀
Streaming 24/7 • Hituri • Vibe de top 🎧
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📩 contact@diliul.ro
Reclamă Reclamă
Scrie răspuns

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Înregistrare

Sign in

Înapoi la “Plugin-uri”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 0 vizitatori