Page 1 of 1
Gun exp HP
Posted: 2011 May 05 20:47
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 :]
Re: Gun exp HP
Posted: 2011 May 05 21:29
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
Re: Gun exp HP
Posted: 2011 May 06 06:24
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); }}
Re: Gun exp HP
Posted: 2011 May 06 10:10
by xFrostas
turi daryti su set.... ir kas čia per tikrinimas?
Re: Gun exp HP
Posted: 2011 May 06 12:54
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
..
Re: Gun exp HP
Posted: 2011 May 06 14:31
by nuodas159
na aisq. dq +karma