Page 1 of 1
Atimti Ginklus ir Armor
Posted: 2010 Sep 04 12:01
by edgaras85
Kaip padaryti kad ant naujo roundo atimtu visus ginklus?
strip weapons?
ir kodel neveikia sis kodas
Code: Select all
#include <amxmodx> #include <cstrike>#include <fun> new g_iMaxPlayers; public plugin_init() { register_logevent( "EventRoundStart", 2, "1=Round_Start" ); g_iMaxPlayers = get_maxplayers( ); } public EventRoundStart( ) { for( new i = 1; i <= g_iMaxPlayers; i++ ) { if (is_user_alive(i)) { set_user_armor(i, 0); } }}
Re: Atimti Ginklus ir Armor
Posted: 2010 Sep 04 15:18
by aurimasko
edgaras85 wrote:Kaip padaryti kad ant naujo roundo atimtu visus ginklus?
strip weapons?
ir kodel neveikia sis kodas
Code: Select all
#include <amxmodx> #include <cstrike>#include <fun> new g_iMaxPlayers; public plugin_init() { register_logevent( "EventRoundStart", 2, "1=Round_Start" ); g_iMaxPlayers = get_maxplayers( ); } public EventRoundStart( ) { for( new i = 1; i <= g_iMaxPlayers; i++ ) { if (is_user_alive(i)) { set_user_armor(i, 0); } }}
Gal aš kažką netaip suprantu, bet ar negalima padaryti taip:
Code: Select all
#include <amxmodx> #include <cstrike>#include <fun> public plugin_init() { register_logevent( "EventRoundStart", 2, "1=Round_Start" ); } public EventRoundStart(id) { if(is_user_alive(id)) { set_user_armor(id, 0); } }}
Re: Atimti Ginklus ir Armor
Posted: 2010 Sep 04 15:43
by aaarnas
Code: Select all
#include <amxmodx>#include <fun> #define PLUGIN "Plugin"#define VERSION "1.0"#define AUTHOR "aaarnas" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("HLTV", "event_round_start", "a", "1=0", "2=0")} public event_round_start() { new players[32], num get_players(players, num, "ah") for(new i=0; i<num; i++) strip_user_weapons(i)}
Re: Atimti Ginklus ir Armor
Posted: 2010 Sep 04 17:06
by edgaras85
aaarnas wrote:Code: Select all
#include <amxmodx>#include <fun> #define PLUGIN "Plugin"#define VERSION "1.0"#define AUTHOR "aaarnas" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("HLTV", "event_round_start", "a", "1=0", "2=0")} public event_round_start() { new players[32], num get_players(players, num, "ah") for(new i=0; i<num; i++) strip_user_weapons(i)}
Neveikia

Re: Atimti Ginklus ir Armor
Posted: 2010 Sep 04 17:42
by aaarnas
Tada daryk taip:
Code: Select all
#include <amxmodx>#include <hamsandwich>#include <fun> #define PLUGIN "Plugin"#define VERSION "1.0"#define AUTHOR "aaarnas" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) RegisterHam(Ham_Spawn, "player", "player_spawn", 1)} public player_spawn(id) { strip_user_weapons(id) give_item(id, "weapon_knife")
Re: Atimti Ginklus ir Armor
Posted: 2010 Sep 04 18:03
by eNz0
Arba taip:
Code: Select all
#include <amxmodx>#include <fun> #define PLUGIN "Plugin"#define VERSION "1.0"#define AUTHOR "eNz0" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("HLTV", "event_round_start", "a", "1=0", "2=0")} public event_round_start() { set_task(0.3, "task_strip")} public task_strip(){ new players[32], num get_players(players, num, "ah") for(new i=1; i<num; i++) { strip_user_weapons(i) give_item(i, "weapon_knife") }}
Re: Atimti Ginklus ir Armor
Posted: 2010 Sep 04 18:05
by aaarnas
Lygiai taip pat mėginau, bet nedirbo

Man atrodo HLTV iškviečiamas dar ankščiau nei žaidėjas gauna ginklus.
Re: Atimti Ginklus ir Armor
Posted: 2010 Sep 04 18:09
by eNz0
Man kiek atsimenu išvis HLTV sunkiai veikė su žaidėjų identifikacija
Tas būdas kur parašiau veikia, pratestavau

Re: Atimti Ginklus ir Armor
Posted: 2010 Sep 04 20:32
by edgaras85
aaarnas wrote:Tada daryk taip:
Code: Select all
#include <amxmodx>#include <hamsandwich>#include <fun> #define PLUGIN "Plugin"#define VERSION "1.0"#define AUTHOR "aaarnas" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) RegisterHam(Ham_Spawn, "player", "player_spawn", 1)} public player_spawn(id) { strip_user_weapons(id) give_item(id, "weapon_knife")
Aciu veikia
L 09/04/2010 - 22:02:08: [FUN] Invalid player 6
L 09/04/2010 - 22:02:08: [AMXX] Displaying debug trace (plugin "zp_weaps.amxx")
L 09/04/2010 - 22:02:08: [AMXX] Run time error 10: native error (native "strip_user_weapons")
L 09/04/2010 - 22:02:08: [AMXX] [0] zp_weaps.sma::player_spawn (line 17)
L 09/04/2010 - 22:02:13: [FUN] Invalid player 11
L 09/04/2010 - 22:02:13: [AMXX] Displaying debug trace (plugin "zp_weaps.amxx")
L 09/04/2010 - 22:02:13: [AMXX] Run time error 10: native error (native "strip_user_weapons")
L 09/04/2010 - 22:02:13: [AMXX] [0] zp_weaps.sma::player_spawn (line 17)
Re: Atimti Ginklus ir Armor
Posted: 2010 Sep 04 21:15
by aaarnas
Vuups. Pamiršau:
Code: Select all
#include <amxmodx>#include <hamsandwich>#include <fun> #define PLUGIN "Plugin"#define VERSION "1.0"#define AUTHOR "aaarnas" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) RegisterHam(Ham_Spawn, "player", "player_spawn", 1)} public player_spawn(id) { if(!is_user_alive(id)) return HAM_IGNORED; strip_user_weapons(id) give_item(id, "weapon_knife")