
ZArejestrowalem komende na bind "wybuch":
register_clcmd("wybuch", "Eksploduj")
A public Eksploduj wyglada tak:
public Eksploduj(id) { new Float:fOrigin[3], iOrigin[3]; entity_get_vector( id, EV_VEC_origin, fOrigin); iOrigin[0] = floatround(fOrigin[0]); iOrigin[1] = floatround(fOrigin[1]); iOrigin[2] = floatround(fOrigin[2]); 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] + 300 ); write_coord( iOrigin[2] + 300 ); write_short( sprite_white ); write_byte( 0 ); // startframe write_byte( 0 ); // framerate write_byte( 10 ); // life write_byte( 10 ); // width write_byte( 400 ); // 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( 8 ); // speed message_end(); new entlist[33]; new numfound = find_sphere_class(id, "player", 400.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) || klasa_gracza[id] == Kamikadze) continue; ExecuteHam(Ham_TakeDamage, pid, 0, id, 200.0+float(inteligencja_gracza[id]) , 1); } return PLUGIN_CONTINUE; }
W tym momencie po zbindowaniu "wybuch" wybucha i nie zabija sam siebie, chodzi mi o to, żeby jeszcze sam się zabijał.