Zrobilem sobie prosta klase z wbudowana autodestrukcja i chcialbym do niej dodac odpornosc ale nie bardzo wiem jak. Ma to dzialac na takiej zasadzie jak np odpornosc na miny. proszę o pomoc.
if(equal(classname, "mine")) return HAM_SUPERCEDE;
kod z klasy:
public cod_class_enabled(id) { ma_klase[id] = true; ilosc_dynamitow[id] = 1; } public cod_class_disabled(id) { ma_klase[id] = false; ilosc_dynamitow[id] = 0; } public cod_class_skill_used(id) { if(!ilosc_dynamitow[id]) { client_print(id, print_center, "Wykorzystales juz dynamit!"); } else { ilosc_dynamitow[id]--; new Float:fOrigin[3]; entity_get_vector(id, EV_VEC_origin, fOrigin); new iOrigin[3]; for(new i=0;i<=2;i++) iOrigin[i] = floatround(fOrigin[i]); message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin); write_byte(TE_EXPLOSION); write_coord(iOrigin[0]); write_coord(iOrigin[1]); write_coord(iOrigin[2]); write_short(sprite_blast); write_byte(32); write_byte(20); write_byte(0); message_end(); 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]+200); write_coord(iOrigin[2]+200); write_short(sprite_white); write_byte(0); // startframe write_byte(0); // framerate write_byte(10); // life write_byte(10); // width write_byte(255); // noise write_byte(0); // r, g, b write_byte(100);// r, g, b write_byte(255); // r, g, b write_byte(120); // brightness write_byte(0); // speed message_end(); new entlist[33]; new numfound = find_sphere_class(id, "player", 50.0 , entlist, 32); for(new i=0; i<=numfound; i++) { new pid = entlist[i]; if(!is_user_alive(pid) || get_user_team(id) == get_user_team(pid)) continue; cod_inflict_damage(id, pid, 80.0, 0.3); } } return PLUGIN_CONTINUE; } public fwSpawn_Dynamit(id) { if(is_user_alive(id) && ma_klase[id]) { ilosc_dynamitow[id] = 1; } return HAM_IGNORED; }