Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
-
nuodas159
- Flooderis arba specialistas
- Posts: 522
- Joined: 2010 Sep 03 15:30
- Skype: nuodas159
- Location: SunCity
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 :]
-
aurimasko
- Flooderis arba specialistas
- Posts: 736
- Joined: 2010 Sep 04 08:45
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
-
nuodas159
- Flooderis arba specialistas
- Posts: 522
- Joined: 2010 Sep 03 15:30
- Skype: nuodas159
- Location: SunCity
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); }}
-
xFrostas
- Flooderis arba specialistas
- Posts: 660
- Joined: 2010 Sep 02 15:47
- Skype: frost.lt
Post
by xFrostas »
turi daryti su set.... ir kas čia per tikrinimas?
-
aurimasko
- Flooderis arba specialistas
- Posts: 736
- Joined: 2010 Sep 04 08:45
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
..
-
nuodas159
- Flooderis arba specialistas
- Posts: 522
- Joined: 2010 Sep 03 15:30
- Skype: nuodas159
- Location: SunCity
Post
by nuodas159 »
na aisq. dq +karma
Users browsing this forum: Ahrefs [Bot] and 2 guests