tutaj podaje kod sma:
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fun>
#include <hamsandwich>
#include <cstrike>
new const nazwa[] = "Kapitan[Premium]";
new const opis[] = "Dostaje 120 HP, 250 pancerza, M4A1, AWP, HEGRENADE, ma 1/2 szansy na zabicie z HE i 1/1 z AWP ";
new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_AWP)|(1<<CSW_M4A1);
new const zdrowie = 20;
new const kondycja = 10;
new const inteligencja = 15;
new const wytrzymalosc = 20;
new ma_klase[33]
new oneonone[33][31]
public plugin_init()
{
register_plugin(nazwa, "1.0", "amxx.pl");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
RegisterHam(Ham_Spawn, "player", "Spawn", 1);
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_)
{
client_print(id, print_chat, "[Kapitan[Premium]] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
give_item(id, "weapon_hegrenade");
oneonone[id][CSW_AWP] = 1
oneonone[id][CSW_HEGRENADE] = 2
ma_klase[id] = 1;
cs_set_user_armor(id, 250, CS_ARMOR_KEVLAR);
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
ma_klase[id] = 0;
oneonone[id][CSW_AWP] = 0
oneonone[id][CSW_HEGRENADE] = 0
cs_set_user_armor(id, 0, CS_ARMOR_KEVLAR);
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(!(damagebits & (1<<24)))
return HAM_IGNORED;
new hp_ofiary = get_user_health(this)
new bron_atakujacego = get_user_weapon(idattacker)
if (oneonone[idattacker][bron_atakujacego] > 0)
{
if (random_num(1,oneonone[idattacker][bron_atakujacego]) == 1) cod_inflict_damage(idattacker, this, float(hp_ofiary), 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
jest kilka błędów:
po pierwsze: chcę, aby było 1/1 z AWP i 1/2 z HE ( umiem zrobić tylko, że działa albo to albo to 1<<1 na AWP 1<<24 na HE ale nie wiem jak to połączyć )
po drugie, sypie w logach takie błędy:
[error""]
L 02/04/2012 - 18:45:02: [AMXX] Displaying debug trace (plugin "codclass_kapitan_b.amxx")
L 02/04/2012 - 18:45:02: [AMXX] Run time error 10: native error (native "RegisterHam")
L 02/04/2012 - 18:45:02: [AMXX] [0] codclass_kapitan_b.sma::plugin_init (line 28)
L 02/04/2012 - 18:47:54: Start of error session.
L 02/04/2012 - 18:47:54: Info (map "de_dust") (file "addons/amxmodx/logs/error_20120204.log")
L 02/04/2012 - 18:47:54: [AMXX] Plugin file open error (plugin "cod_wskrzeszanie")
L 02/04/2012 - 18:47:54: [HAMSANDWICH] Function Spawn not found.
L 02/04/2012 - 18:47:54: [AMXX] Displaying debug trace (plugin "codclass_kapitan_b.amxx")
L 02/04/2012 - 18:47:54: [AMXX] Run time error 10: native error (native "RegisterHam")
L 02/04/2012 - 18:47:54: [AMXX] [0] codclass_kapitan_b.sma::plugin_init (line 28)
L 02/04/2012 - 19:03:52: Start of error session.
L 02/04/2012 - 19:03:52: Info (map "starwars") (file "addons/amxmodx/logs/error_20120204.log")
L 02/04/2012 - 19:03:52: [AMXX] Plugin file open error (plugin "cod_wskrzeszanie")
L 02/04/2012 - 19:03:52: [HAMSANDWICH] Function Spawn not found.
L 02/04/2012 - 19:03:52: [AMXX] Displaying debug trace (plugin "codclass_kapitan_b.amxx")
L 02/04/2012 - 19:03:52: [AMXX] Run time error 10: native error (native "RegisterHam")
L 02/04/2012 - 19:03:52: [AMXX] [0] codclass_kapitan_b.sma::plugin_init (line 28)
L 02/04/2012 - 19:07:57: Start of error session.
L 02/04/2012 - 19:07:57: Info (map "starwars") (file "addons/amxmodx/logs/error_20120204.log")
L 02/04/2012 - 19:07:57: [AMXX] Plugin file open error (plugin "cod_wskrzeszanie")
L 02/04/2012 - 19:07:57: [HAMSANDWICH] Function Spawn not found.
L 02/04/2012 - 19:07:57: [AMXX] Displaying debug trace (plugin "codclass_kapitan_b.amxx")
L 02/04/2012 - 19:07:57: [AMXX] Run time error 10: native error (native "RegisterHam")
L 02/04/2012 - 19:07:57: [AMXX] [0] codclass_kapitan_b.sma::plugin_init (line 28)
L 02/04/2012 - 19:16:48: Start of error session.
L 02/04/2012 - 19:16:48: Info (map "starwars") (file "addons/amxmodx/logs/error_20120204.log")
L 02/04/2012 - 19:16:48: [AMXX] Plugin file open error (plugin "cod_wskrzeszanie")
L 02/04/2012 - 19:16:48: [HAMSANDWICH] Function Spawn not found.
L 02/04/2012 - 19:16:48: [AMXX] Displaying debug trace (plugin "codclass_kapitan_b.amxx")
L 02/04/2012 - 19:16:48: [AMXX] Run time error 10: native error (native "RegisterHam")
L 02/04/2012 - 19:16:48: [AMXX] [0] codclass_kapitan_b.sma::plugin_init (line 28)
L 02/04/2012 - 19:34:43: Start of error session.
L 02/04/2012 - 19:34:43: Info (map "de_kabul") (file "addons/amxmodx/logs/error_20120204.log")
L 02/04/2012 - 19:34:43: [AMXX] Plugin file open error (plugin "cod_wskrzeszanie")
L 02/04/2012 - 19:34:43: [HAMSANDWICH] Function Spawn not found.
L 02/04/2012 - 19:34:43: [AMXX] Displaying debug trace (plugin "codclass_kapitan_b.amxx")
L 02/04/2012 - 19:34:43: [AMXX] Run time error 10: native error (native "RegisterHam")
L 02/04/2012 - 19:34:43: [AMXX] [0] codclass_kapitan_b.sma::plugin_init (line 28)
L 02/04/2012 - 19:50:22: Start of error session.
L 02/04/2012 - 19:50:22: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20120204.log")
L 02/04/2012 - 19:50:22: [AMXX] Plugin file open error (plugin "cod_wskrzeszanie")
L 02/04/2012 - 19:50:22: [HAMSANDWICH] Function Spawn not found.
L 02/04/2012 - 19:50:22: [AMXX] Displaying debug trace (plugin "codclass_kapitan_b.amxx")
L 02/04/2012 - 19:50:22: [AMXX] Run time error 10: native error (native "RegisterHam")
L 02/04/2012 - 19:50:22: [AMXX] [0] codclass_kapitan_b.sma::plugin_init (line 28)
L 02/04/2012 - 19:59:53: Start of error session.
L 02/04/2012 - 19:59:53: Info (map "de_dust") (file "addons/amxmodx/logs/error_20120204.log")
L 02/04/2012 - 19:59:53: [HAMSANDWICH] Function Spawn not found.
L 02/04/2012 - 19:59:53: [AMXX] Displaying debug trace (plugin "codclass_kapitan_b.amxx")
L 02/04/2012 - 19:59:53: [AMXX] Run time error 10: native error (native "RegisterHam")
L 02/04/2012 - 19:59:53: [AMXX] [0] codclass_kapitan_b.sma::plugin_init (line 28)
L 02/04/2012 - 20:15:31: Start of error session.
L 02/04/2012 - 20:15:31: Info (map "cs_assault") (file "addons/amxmodx/logs/error_20120204.log")
L 02/04/2012 - 20:15:31: [HAMSANDWICH] Function Spawn not found.
L 02/04/2012 - 20:15:31: [AMXX] Displaying debug trace (plugin "codclass_kapitan_b.amxx")
L 02/04/2012 - 20:15:31: [AMXX] Run time error 10: native error (native "RegisterHam")
L 02/04/2012 - 20:15:31: [AMXX] [0] codclass_kapitan_b.sma::plugin_init (line 28)
[/error]
prosiłbym o pomoc, odwdzięcze się plusem ^ ^
Użytkownik Artemis edytował ten post 04.02.2012 20:37