Witam mam problem z klasą, gdy uruchamiam cs'a i odpalam localhosta (new game) to nagle się wyłącza.
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <codmod> #include <fakemeta> #include <xs> #include <hamsandwich> #include <engine> #include <codmod_frakcje> #define PLUGIN_AUTHOR "TaRoNe" // Wielkosc workow #define PALLET_MINS Float:{ -27.260000, -22.280001, -22.290001 } #define PALLET_MAXS Float:{ 27.340000, 26.629999, 29.020000 } #define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2) #define fm_remove_entity(%1) engfunc(EngFunc_RemoveEntity, %1) #define fm_drop_to_floor(%1) engfunc(EngFunc_DropToFloor,%1) new const nazwa[] = "[Human]Inzynier"; new const opis[] = "Mozesz stawiac worki z piaskiem na mapce"; new const bronie = 1<<CSW_MP5NAVY | 1<<CSW_HEGRENADE; new const zdrowie = 25; new const kondycja = 0; new const inteligencja = 0; new const wytrzymalosc = 0; new bool:ma_klase[33]; new const frakcja[] = "Human"; new remove_nrnd, phealth; new palletscout = 0; new g_models[][] = { "models/QTM_CodMod/pallet_with_bags.mdl", "models/QTM_CodMod/pallet_with_bags2.mdl" } new g_class[] = "amxx_pallets"; new ilosc_workow_gracza[33]; new poprzedni_worek_gracza[33]; public plugin_init() { register_plugin(nazwa, "1.0", "TaRoNe"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc, frakcja"); remove_nrnd = register_cvar("pallets_wbags_nroundrem","1"); phealth = register_cvar("pallets_wbags_health","0"); register_event("HLTV","event_newround", "a","1=0", "2=0"); RegisterHam(Ham_Spawn, "player", "fwSpawn_Worki", 1); } public plugin_precache() { for(new i;i < sizeof g_models;i++) engfunc(EngFunc_PrecacheModel,g_models[i]); } public cod_class_enabled(id) { if(get_user_team(id) == 1) // tu ustawiasz ktora druzyna moze grac ta klasa; 1-CT, 2-TT { client_print(id, print_chat, "Ta klase moze wybrac tylko human.") return COD_CONTINUE; ma_klase[id] = true; ilosc_workow_gracza[id] = 9; return COD_STOP; } public cod_class_disabled(id) { ma_klase[id] = false; } public cod_class_skill_used(id) { if (!ilosc_workow_gracza[id]) { client_print(id, print_center, "Wykorzystales juz wszystkie worki"); } else { if (is_user_alive(id)) { poprzedni_worek_gracza[id] = floatround(get_gametime()); ilosc_workow_gracza[id]--; new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_wall")); set_pev(ent,pev_classname,g_class); engfunc(EngFunc_SetModel,ent,g_models[random(sizeof g_models)]); static Float:xorigin[3]; get_user_hitpoint(id,xorigin); if(engfunc(EngFunc_PointContents,xorigin) == CONTENTS_SKY) { client_print(id, print_center, "Workow nie mozna stawiac w powietrzu"); return PLUGIN_HANDLED; } static Float:p_mins[3], Float:p_maxs[3]; p_mins = PALLET_MINS; p_maxs = PALLET_MAXS; engfunc(EngFunc_SetSize, ent, p_mins, p_maxs); set_pev(ent, pev_mins, p_mins); set_pev(ent, pev_maxs, p_maxs ); set_pev(ent, pev_absmin, p_mins); set_pev(ent, pev_absmax, p_maxs ); engfunc(EngFunc_SetOrigin, ent, xorigin); set_pev(ent,pev_solid,SOLID_BBOX); set_pev(ent,pev_movetype,MOVETYPE_FLY); new Float:p_cvar_health = get_pcvar_float(phealth); switch(p_cvar_health) { case 0.0 : { set_pev(ent,pev_takedamage,DAMAGE_NO); } default : { set_pev(ent,pev_health,p_cvar_health); set_pev(ent,pev_takedamage,DAMAGE_YES); } } static Float:rvec[3]; pev(id,pev_v_angle,rvec); rvec[0] = 0.0; set_pev(ent,pev_angles,rvec); fm_drop_to_floor(ent); palletscout++; client_print(id, print_center, "Postawiles worki"); return PLUGIN_HANDLED; } } return PLUGIN_CONTINUE; } public fwSpawn_Worki(id) { if(is_user_alive(id)) ilosc_workow_gracza[id] = 9; // tutaj zmieniamy ilosc workow, powinna byc rowna ilosci w public cod_class_enabled } public event_newround() { if( get_pcvar_num ( remove_nrnd ) == 1) remove_entity_name(g_class) } stock remove_allpalletswbags() { new pallets = -1; while((pallets = fm_find_ent_by_class(pallets, g_class))) fm_remove_entity(pallets); palletscout = 0; } stock get_user_hitpoint(id, Float:hOrigin[3]) { if ( ! is_user_alive( id )) return 0; new Float:fOrigin[3], Float:fvAngle[3], Float:fvOffset[3], Float:fvOrigin[3], Float:feOrigin[3]; new Float:fTemp[3]; pev(id, pev_origin, fOrigin); pev(id, pev_v_angle, fvAngle); pev(id, pev_view_ofs, fvOffset); xs_vec_add(fOrigin, fvOffset, fvOrigin); engfunc(EngFunc_AngleVectors, fvAngle, feOrigin, fTemp, fTemp); xs_vec_mul_scalar(feOrigin, 9999.9, feOrigin); xs_vec_add(fvOrigin, feOrigin, feOrigin); engfunc(EngFunc_TraceLine, fvOrigin, feOrigin, 0, id); global_get(glb_trace_endpos, hOrigin); return 1; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par } */