Gun exp HP

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
Post Reply
User avatar
nuodas159
Flooderis arba specialistas
Posts: 522
Joined: 2010 Sep 03 15:30
Skype: nuodas159
Location: SunCity

Gun exp HP

Post by nuodas159 »

Code: Select all

#include <amxmodx>#include <cstrike>#include <hamsandwich>#include <gunxpmod> new bool:GiveHP[33] new PLUGIN_NAME[]   = "UNLOCK : HP"new PLUGIN_AUTHOR[]     = "GuM"new PLUGIN_VERSION[]    = "1.0" public plugin_init(){    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)    register_plugin( "HP", "1.0", "GuM" )     register_gxm_item("Hp +50", "Give hp +50", 60)    register_cvar("give_hp","50")     RegisterHam(Ham_Spawn, "player", "fwd_PlayerSpawn", 1)} public gxm_item_enabled(id) {    GiveHP[id] = true;     if ( is_user_alive(id) )    {        if ( !get_user_hp(id) )        {            get_user_hp(id, true);        }    }} public client_connect(id) {    GiveHP[id] = false;} public fwd_PlayerSpawn(id){    if ( !is_user_alive(id) || !GiveHP[id] )        return;     if ( !get_user_hp(id) )    {        get_user_hp(id, true);    }}
Bandziau padaryti ,kad hp duotu ,bet neiseina kodel blogai? +karma P.S Bandau kazka ikirsti ir ismokti :]
Image

User avatar
aurimasko
Flooderis arba specialistas
Posts: 736
Joined: 2010 Sep 04 08:45

Re: Gun exp HP

Post by aurimasko »

nuodas159 wrote:

Code: Select all

#include <amxmodx>#include <cstrike>#include <hamsandwich>#include <gunxpmod> new bool:GiveHP[33] new PLUGIN_NAME[]   = "UNLOCK : HP"new PLUGIN_AUTHOR[]     = "GuM"new PLUGIN_VERSION[]    = "1.0" public plugin_init(){    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)    register_plugin( "HP", "1.0", "GuM" )     register_gxm_item("Hp +50", "Give hp +50", 60)    register_cvar("give_hp","50")     RegisterHam(Ham_Spawn, "player", "fwd_PlayerSpawn", 1)} public gxm_item_enabled(id) {    GiveHP[id] = true;     if ( is_user_alive(id) )    {        if ( !get_user_hp(id) )        {            get_user_hp(id, true);        }    }} public client_connect(id) {    GiveHP[id] = false;} public fwd_PlayerSpawn(id){    if ( !is_user_alive(id) || !GiveHP[id] )        return;     if ( !get_user_hp(id) )    {        get_user_hp(id, true);    }}
Bandziau padaryti ,kad hp duotu ,bet neiseina kodel blogai? +karma P.S Bandau kazka ikirsti ir ismokti :]
get_user_health
set_user_health

User avatar
nuodas159
Flooderis arba specialistas
Posts: 522
Joined: 2010 Sep 03 15:30
Skype: nuodas159
Location: SunCity

Re: Gun exp HP

Post by nuodas159 »

Na pasidariau ,bet jis neduoda tuos hp. Gal kas padetu?

Code: Select all

#include <amxmodx>#include <cstrike>#include <hamsandwich>#include <gunxpmod> new bool:GiveHP[33] new PLUGIN_NAME[]   = "UNLOCK : HP"new PLUGIN_AUTHOR[]     = "GuM"new PLUGIN_VERSION[]    = "1.0" public plugin_init(){    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)    register_plugin( "HP", "1.0", "GuM" )     register_gxm_item("Hp +50", "Give hp +50", 60)    register_cvar("give_hp","50")     RegisterHam(Ham_Spawn, "player", "fwd_PlayerSpawn", 1)} public gxm_item_enabled(id){    GiveHP[id] = true;     if ( is_user_alive(id) )    {        if ( !get_user_health(id) )        {            get_user_health(id);        }    }} public client_connect(id){    GiveHP[id] = false;} public fwd_PlayerSpawn(id){    if ( !is_user_alive(id) || !GiveHP[id] )        return;     if ( !get_user_health(id) )    {        get_user_health(id);    }}
Image

User avatar
xFrostas
Flooderis arba specialistas
Posts: 660
Joined: 2010 Sep 02 15:47
Skype: frost.lt

Re: Gun exp HP

Post by xFrostas »

turi daryti su set.... ir kas čia per tikrinimas?

Code: Select all

    if ( !get_user_health(id) )

User avatar
aurimasko
Flooderis arba specialistas
Posts: 736
Joined: 2010 Sep 04 08:45

Re: Gun exp HP

Post by aurimasko »

galėtum pasispausti ant nuorodų ir pasiskaityti..

get_user_heath(index) - gražina žaidėjo HP.
set_user_health(index, value) - nustato žaidėjui HP.

Šiuo atveju norėdamas duoti gyvybių turi daryti:

Code: Select all

set_user_health(id, 50) // 50 tai gyvybių skaičius
..

User avatar
nuodas159
Flooderis arba specialistas
Posts: 522
Joined: 2010 Sep 03 15:30
Skype: nuodas159
Location: SunCity

Re: Gun exp HP

Post by nuodas159 »

na aisq. dq +karma
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests