Podmieniłem z modelem oryginalnego vipa, nadal to samo. Także nie jest to wina modelu. Modele v_, p_ broni się pokazują. Problem występuje tylko z modelem gracza. Kod klasy:
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
new const nazwa[] = "GRZEJSZCZYK [ULTRA PREMIUM]";
new const opis[] = "nic dodac nic ujac";
new const bronie = (1<<CSW_SMOKEGRENADE)|(1<<CSW_ELITE)|(1<<CSW_M3);
new const zdrowie = 100;
new const kondycja = 100;
new const inteligencja = 1;
new const wytrzymalosc = 1;
new sprite_white_apteczki;
new ilosc_apteczek_gracza[33];
new ma_klase[33];
public plugin_init()
{
register_plugin(nazwa, "1.0", "amxx.pl");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_think("medkit", "Think_Apteczki");
RegisterHam(Ham_Spawn, "player", "fwSpawn_Apteczki", 1);
RegisterHam( Ham_Spawn, "player", "fwSpawn_ModelGracza" );
register_event("CurWeapon", "ModelBroni_CurWeapon", "be", "1=1");
register_forward(FM_SetModel, "ModelBroni_fw_SetModel");
}
public plugin_precache()
{
sprite_white_apteczki = precache_model("sprites/white.spr");
precache_model("models/w_medkit.mdl");
static szModel[ ] = "models/player/zejv/zejv.mdl";
precache_model( szModel );
precache_model("models/p_lom.mdl");
precache_model("models/v_lom.mdl");
}
public client_disconnect(id)
{
new entApteczki = find_ent_by_class(0, "medkit");
while(entApteczki > 0)
{
if(entity_get_edict(entApteczki, EV_ENT_owner) == id)
remove_entity(entApteczki);
entApteczki = find_ent_by_class(entApteczki, "medkit");
}
}
public cod_class_enabled(id)
{
ilosc_apteczek_gracza[id] = 2;
give_item(id, "weapon_smokegrenade");
ma_klase[id] = true;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public cod_class_skill_used(id)
{
if (!ilosc_apteczek_gracza[id])
{
client_print(id, print_center, "Masz tylko 2 apteczki na runde!");
}
else
{
ilosc_apteczek_gracza[id]--;
new Float:origin[3];
entity_get_vector(id, EV_VEC_origin, origin);
new ent = create_entity("info_target");
entity_set_string(ent, EV_SZ_classname, "medkit");
entity_set_edict(ent, EV_ENT_owner, id);
entity_set_int(ent, EV_INT_solid, SOLID_NOT);
entity_set_vector(ent, EV_VEC_origin, origin);
entity_set_float(ent, EV_FL_ltime, halflife_time() + 7 + 0.1);
entity_set_model(ent, "models/w_medkit.mdl");
set_rendering ( ent, kRenderFxGlowShell, 255,0,0, kRenderFxNone, 255 ) ;
drop_to_floor(ent);
entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.1);
}
}
public fwSpawn_Apteczki(id)
{
if(is_user_alive(id))
ilosc_apteczek_gracza[id] = 2;
}
public Think_Apteczki(ent)
{
if(!is_valid_ent(ent))
return PLUGIN_CONTINUE;
new id = entity_get_edict(ent, EV_ENT_owner);
new dist = 300;
new heal = 5+floatround(cod_get_user_intelligence(id)*0.5);
if (entity_get_edict(ent, EV_ENT_euser2) == 1)
{
new Float:forigin[3];
entity_get_vector(ent, EV_VEC_origin, forigin);
new entlist[33];
new numfound = find_sphere_class(0,"player", float(dist),entlist, 32,forigin);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (get_user_team(pid) != get_user_team(id))
continue;
new maksymalne_zdrowie = 100+cod_get_user_health(pid);
new zdrowie = get_user_health(pid);
new Float:nowe_zdrowie = (zdrowie+heal<maksymalne_zdrowie)?zdrowie+heal+0.0:maksymalne_zdrowie+0.0;
if (is_user_alive(pid)) entity_set_float(pid, EV_FL_health, nowe_zdrowie);
}
entity_set_edict(ent, EV_ENT_euser2, 0);
entity_set_float(ent, EV_FL_nextthink, halflife_time() + 1.5);
return PLUGIN_CONTINUE;
}
if (entity_get_float(ent, EV_FL_ltime) < halflife_time() || !is_user_alive(id))
{
remove_entity(ent);
return PLUGIN_CONTINUE;
}
if (entity_get_float(ent, EV_FL_ltime)-2.0 < halflife_time())
set_rendering ( ent, kRenderFxNone, 255,255,255, kRenderTransAlpha, 100 );
new Float:forigin[3];
entity_get_vector(ent, EV_VEC_origin, forigin);
new iOrigin[3];
for(new i=0;i<3;i++)
iOrigin[i] = floatround(forigin[i]);
message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
write_byte( TE_BEAMCYLINDER );
write_coord( iOrigin[0] );
write_coord( iOrigin[1] );
write_coord( iOrigin[2] );
write_coord( iOrigin[0] );
write_coord( iOrigin[1] + dist );
write_coord( iOrigin[2] + dist );
write_short( sprite_white_apteczki );
write_byte( 0 ); // startframe
write_byte( 0 ); // framerate
write_byte( 10 ); // life
write_byte( 10 ); // width
write_byte( 255 ); // noise
write_byte( 255 ); // r, g, b
write_byte( 100 );// r, g, b
write_byte( 100 ); // r, g, b
write_byte( 128 ); // brightness
write_byte( 0 ); // speed
message_end();
entity_set_edict(ent, EV_ENT_euser2 ,1);
entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.5);
return PLUGIN_CONTINUE;
}
public fwSpawn_ModelGracza( id )
{
if( !is_user_alive( id ) || !ma_klase[ id ] )
return;
engfunc( EngFunc_SetClientKeyValue, id, engfunc( EngFunc_GetInfoKeyBuffer, id ), "model", "zejvv" );
}
public ModelBroni_CurWeapon(id)
{
new weapon = read_data(2);
if(ma_klase[id])
{
if(weapon == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/v_lom.mdl")
set_pev(id, pev_weaponmodel2, "models/p_lom.mdl")
}
}
}
public ModelBroni_fw_SetModel(entity, model[])
{
if(!pev_valid(entity))
return FMRES_IGNORED
if(!equali(model, "models/w_knife.mdl"))
return FMRES_IGNORED;
new entityowner = pev(entity, pev_owner);
if(!ma_klase[entityowner])
return FMRES_IGNORED;
engfunc(EngFunc_SetModel, entity, "")
return FMRES_SUPERCEDE
}
Currently loaded plugins:
name version author file status
[ 1] Admin Base 1.9.0.5294 AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.9.0.5294 AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.9.0.5294 AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0.5294 AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.9.0.5294 AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 10] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 11] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx running
[ 12] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx running
[ 13] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx running
[ 14] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 15] NextMap 1.9.0.5294 AMXX Dev Team nextmap.amxx running
[ 16] TimeLeft 1.9.0.5294 AMXX Dev Team timeleft.amxx running
[ 17] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 18] Stats Configuration 1.9.0.5294 AMXX Dev Team statscfg.amxx running
[ 19] [DR] Okreslony ping 1.2.0 Leqally dr_hpk.amxx running
[ 20] SpeedMeter 2.1 Vertricus dr_speed.amxx running
[ 21] [DR] Tryb FreeRun 1.0 Leqally dr_freerun.amxx running
[ 22] Szybkie Menu 1.2 emu dr_menu.amxx running
[ 23] unknown unknown unknown dr_respawn.amxx running
[ 24] [DR] Klasy, hud, staty 1.0-3 Leqally dr_hud.amxx running
[ 25] Deathrun Manager 3.0.3 xPaw dr_manager.amxx running
[ 26] COD: Klany 1.0.0b d0naciak dr_klany.amxx running
[ 27] System Monet 1.1.1 kisiel96 dr_monety.amxx running
[ 28] unknown unknown unknown dr_wyscig.amxx bad load
[ 29] Super Bunny Hopper 1.2 Cheesy Peteza dr_bunnyhop.amx running
[ 30] Invis 1.0 edited by DarkGL dr_invis.amxx running
[ 31] All Chat 1.1 Ian Cammarata dr_allchat.amxx running
[ 32] Team Join Management 0.3 Exolent dr_join.amxx running
[ 33] CodShop by NiXeL 1.2 NiXeL dr_sklep.amxx running
[ 34] Co mnie bedzie spychal 1.0 R3X dr_antyduck.amx running
[ 35] plugin_trail 1.3.1 Bahrmanou dr_trail.amxx running
[ 36] DeathRun Anti-T Zones 1.1 OciXCrom dr_zone.amxx running
[ 37] Deathrun Stats 0.6 R3X deathrun_stats. error
[ 38] [DR Stats] D�wi�k na p 1.0 R3X dzwiekNaPobicie running
[ 39] [DR Stats] Mniej obcia 1.0 R3X mniejObciazajac running
[ 40] [DR Stats] Bonus za po 1.0 R3X bonusZaPobicieR running
[ 41] [DR Stats] Barney zami 1.0 R3X barneyZamiastRa running
[ 42] DRM: trigger_hurt fix 1.3 coderiz / xPaw DRM_trigger_hur running
[ 43] Speedrun Engine 2.6 new Pwned SREngine_2.6.am debug
[ 44] Speedrun - Simple Data 1.0 Pwned SREngine_dbstuf running
[ 45] Speedrun Stats - 60 FP 2.17c Pwned speedrun_60fps. debug
[ 46] Speedrun Stats - 100 F 2.17c Pwned speedrun_100fps debug
[ 47] Speedrun Stats - 200 F 2.17c Pwned speedrun_200fps debug
[ 48] Speedrun Stats - 250 F 2.17c Pwned speedrun_250fps debug
[ 49] Speedrun Stats - 333 F 2.17c Pwned speedrun_333fps debug
[ 50] Speedrun Stats - 500 F 2.17c Pwned speedrun_500fps debug
[ 51] Speedrun Stats - 1000 2.17c Pwned speedrun_1000fp debug
[ 52] GameMode - CrazySpeed 2.17c Pwned speedrun_gmode_ debug
[ 53] GameMode - Hard CrazyS 2.17c Pwned speedrun_gmode_ debug
[ 54] GameMode - 2K Run 2.17c Pwned speedrun_gmode_ debug
[ 55] GameMode - 3K Run 2.17c Pwned speedrun_gmode_ debug
[ 56] GameMode - 4K Run 2.17c Pwned speedrun_gmode_ debug
[ 57] unknown unknown unknown speedrun_gmode_ bad load
[ 58] GameMode - Without Aut 2.17c Pwned speedrun_gmode_ debug
[ 59] Stats_v1 1.0 nTiger Stats_v1.amxx debug
[ 60] Box 1.0.2 R3X box.amxx running
[ 61] Box : Get Velocity 1.0 SQN box_3k.amxx running
[ 62] Box : Get Velocity 1.0 SQN box_5k.amxx running
[ 63] Box : Get Velocity 1.0 SQN box_10k.amxx running
[ 64] Box : Get Velocity 1.0 SQN box_20k.amxx running
[ 65] unknown unknown unknown anty_spychanie. bad load
[ 66] Entity Remover 0.4 Exolent entity_remover. running
[ 67] No fall damage 0.2 v3x no_fall_damage. running
[ 68] Only Knife 1.1 Pavulon only_knife.amxx running
[ 69] Bad Spawns Preventer 1.1 xPaw badspawnspreven running
[ 70] MultiPlayer Bhop 1.1.2 ConnorMcLeod mpbhop.amxx running
[ 71] unknown unknown unknown 3pers.amxx running
[ 72] GameMode - 5K Run 2.17c Pwned speedrun_gmode_ debug
[ 73] unknown unknown unknown QTM_CodMod.amxx bad load
[ 74] Normal 1.0 amxx.pl codclass_normal running
[ 75] SpeedRuner 1.0 amxx.pl codclass_speedr running
[ 76] Rakietnik 1.0 amxx.pl codclass_rakiet running
[ 77] Astronauta 1.0 amxx.pl codclass_astron running
[ 78] Assassin [Premium] 1.0 amxx.pl codclass_assass running
[ 79] Skoczek [Premium] 1.0 QTM_Peyote codclass_skocze running
[ 80] Sonic [Ultra Premium] 1.0 amxx.pl codclass_sonic. running
[ 81] Joker [Ultra Premium] 1.0 amxx.pl codclass_joker. running
[ 82] GRZEJSZCZYK [ULTRA PRE 1.0 amxx.pl codclass_grzeju running
[ 83] (Adrenalina) 1.0 QTM_Peyote codperk_adrenal running
[ 84] unknown unknown unknown codperk_apteczk bad load
[ 85] unknown unknown unknown codperk_autodes bad load
[ 86] (Snajperska MOC) 1.0 QTM_Peyote codperk_awpsnaj running
[ 87] (Buty SpeedRunera) 1.0 QTM_Peyote codperk_butykom running
[ 88] (Buty DeathRunera) 1.0 QTM_Peyote codperk_butysna running
[ 89] (Buty Ninjy) 1.0 QTM_Peyote codperk_butyszt running
[ 90] unknown unknown unknown codperk_dynamit bad load
[ 91] Eliminator Rozrzutu 1.0 QTM_Peyote codperk_elimina running
[ 92] Fart Strzelca 1.0 QTM_Peyote codperk_fartstr running
[ 93] Kamizelka NASA 1.0 QTM_Peyote codperk_kamizel running
[ 94] Kamuflaz 1.0 QTM_Peyote codperk_kamufla running
[ 95] Maksymalne skupienie 1.0 QTM_Peyote codperk_maksyma running
[ 96] Modul Odrzutowy 1.0 QTM_Peyote codperk_modulod running
[ 97] Morfina 1.0 QTM_Peyote codperk_morfina running
[ 98] Naboje Kapitana 1.0 QTM_Peyote codperk_nabojek running
[ 99] Naboje Ninjy 1.0 QTM_Peyote codperk_nabojen running
[100] Naboje Pulkownika 1.0 QTM_Peyote codperk_nabojep running
[101] Nano Kamizelka 1.0 QTM_Peyote codperk_nanokam running
[102] Notatki Kapitana 1.0 QTM_Peyote codperk_notatki running
[103] Notatki Ninji 1.0 QTM_Peyote codperk_notatki running
[104] Notatki Sapera 1.0 QTM_Peyote codperk_notatki running
[105] Noz Komandosa 1.0 QTM_Peyote codperk_nozkoma running
[106] Ogranicznik Rozrzutu 1.0 QTM_Peyote codperk_ogranic running
[107] Pancerz Neomexowy 1.0 QTM_Peyote codperk_pancerz running
[108] Platynowe Naboje 1.0 QTM_Peyote codperk_platyno running
[109] Podrecznik Szpiega 1.0 QTM_Peyote codperk_podrecz running
[110] Podwojna Kamizelka 1.0 QTM_Peyote codperk_podwojn running
[111] Przysposobienie obronn 1.0 QTM_Peyote codperk_przyspo running
[112] Rozblysk 1.0 QTM_Peyote codperk_rozblys running
[113] Tajemnica Admirala 1.0 QTM_Peyote codperk_tajemni running
[114] Tajemnica Generala 1.0 QTM_Peyote codperk_tajemni running
[115] Tajemnica Wojskowa 1.0 QTM_Peyote codperk_tajemni running
[116] Tarcza SWAT 1.0 QTM_Peyote codperk_tarczas running
[117] Tytanowe Naboje 1.0 QTM_Peyote codperk_tytanow running
[118] Weteran Noza 1.0 QTM_Peyote codperk_weteran running
[119] Wykrywacz Metali 1.0 QTM_Peyote codperk_wykrywa running
[120] unknown unknown unknown codperk_wyposaz bad load
[121] unknown unknown unknown codperk_wyszkol bad load
[122] unknown unknown unknown codperk_wytreno bad load
[123] unknown unknown unknown codperk_wzmocni bad load
[124] unknown unknown unknown codperk_zaskocz bad load
[125] unknown unknown unknown codperk_zwinnep bad load
( 28) Load fails: Plugin uses an unknown function (name "dr_add_life") - check your modules.ini.
( 37) Error: Cant connect to database
( 57) Load fails: Plugin file open error (plugin "speedrun_gmode_6krun.amxx")
( 65) Load fails: Plugin file open error (plugin "anty_spychanie.amxx")
( 73) Load fails: Plugin file open error (plugin "QTM_CodMod.amxx")
( 84) Load fails: Plugin file open error (plugin "codperk_apteczka.amxx")
( 85) Load fails: Plugin file open error (plugin "codperk_autodestrukcja.amxx")
( 90) Load fails: Plugin file open error (plugin "codperk_dynamit.amxx")
(120) Load fails: Plugin file open error (plugin "codperk_wyposazeniewsparcia.amxx")
(121) Load fails: Plugin file open error (plugin "codperk_wyszkoleniesanitarne.amxx")
(122) Load fails: Plugin file open error (plugin "codperk_wytrenowanyweteran.amxx")
(123) Load fails: Plugin file open error (plugin "codperk_wzmocnionakamizelka.amxx")
(124) Load fails: Plugin file open error (plugin "codperk_zaskoczeniewroga.amxx")
(125) Load fails: Plugin file open error (plugin "codperk_zwinnepalce.amxx")
125 plugins, 111 running
Wersja AMXX:
AMX Mod X 1.9.0.5294 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Dec 3 2021 15:54:56
Built from: https://github.com/alliedmodders/amxmodx/commit/363871a
Build ID: 5294:363871a
Core mode: JIT+ASM32
Stawiam bronka za pomoc w rozwiązaniu problemu... Dzięki i pozdrawiam 