Wiem, że w tym pluginie coś takiego jest ale nie wiem, która to funkcja :
Spoiler
#include <amxmodx> #include <fakemeta> #include <engine> #include <codmod> #include <colorchat> #if cellbits == 32 #define OFFSET_CSMONEY 115 #else #define OFFSET_CSMONEY 140 #endif #define OFFSET_LINUX 5 enum CsTeams { CS_TEAM_UNASSIGNED = 0, CS_TEAM_T = 1, CS_TEAM_CT = 2, CS_TEAM_SPECTATOR = 3 } new sprte; new bool:shock[32]; new bool:atombomb[32]; #define pev_flare pev_iuser4 #define flare_id 1337 #define is_ent_flare(%1) (pev(%1, pev_flare) == flare_id) ? 1 : 0 new BlueFlare, Shockwave new bool:nuclearReady; new bool:pCalling[32]; new callAttemps[32]; static stCommander; new g_Explosion new cvar_elektrocost, cvar_nuclearcost; public plugin_init() { register_plugin("Air Supports", "1.0", "byetovice") register_cvar("sata_version", "1.0", FCVAR_SPONLY|FCVAR_SERVER) cvar_elektrocost = register_cvar("sata_hit_cost","0") cvar_nuclearcost = register_cvar("sata_atom_cost","0") register_clcmd("say /sata","ElectroBuy") register_clcmd("say_team /sata","ElectroBuy") register_event("ResetHUD", "player_spawn", "b") register_concmd("+calling","CallAir") register_concmd("-calling","CallIptal") register_forward(FM_SetModel, "fwd_setmodel") register_forward(FM_Think, "fwd_think") register_logevent("LogEvent_Round_Start", 2, "1=Round_Start") stCommander = 0 nuclearReady = true; } public plugin_precache() { sprte = precache_model("sprites/zbeam4.spr") precache_sound("ambience/siren.wav") // precache_sound("ambience/jetflyby1.wav") // precache_sound("weapons/mortarhit.wav") // precache_sound("weapons/mortar.wav") // Shockwave = precache_model("sprites/shockwave.spr") BlueFlare = precache_model("sprites/blueflare2.spr") g_Explosion = precache_model("sprites/zerogxplode.spr") precache_sound("weapons/mine_charge.wav") // precache_sound("weapons/explode4.wav") // } public LogEvent_Round_Start(id) { remove_task(1453) remove_task(1071) remove_task(2011) remove_task(3162) client_cmd(0,"stopsound") stCommander = 0 } public client_connect(id) { shock[id] = false; atombomb[id] = false; pCalling[id] = false; callAttemps[id] = 0; } public client_disconnect(id) { shock[id] = false; atombomb[id] = false; pCalling[id] = false; callAttemps[id] = 0; } public player_spawn(id) { shock[id] = false; atombomb[id] = false; pCalling[id] = false; callAttemps[id] = 0; cod_take_weapon(id, CSW_SMOKEGRENADE); } public fwd_setmodel(ent, const model[]) { new powner = entity_get_edict(ent,EV_ENT_owner) if(!pev_valid(ent) || !equal(model[9], "smokegrenade.mdl") || !shock[powner]) return FMRES_IGNORED static classname[32]; pev(ent, pev_classname, classname, 31) if(equal(classname, "grenade")) { set_pev(ent, pev_nextthink, get_gametime() + 10.0) set_task(6.0,"charging",3162) set_pev(ent, pev_flare, flare_id) return FMRES_SUPERCEDE } return FMRES_IGNORED } public fwd_think(ent, id) { if(pev_valid(ent) && is_ent_flare(ent)) { new powner = entity_get_edict(ent,EV_ENT_owner) if(shock[powner]) { new start[3] new Float:fstart[3] entity_get_vector(ent,EV_VEC_origin,fstart) engfunc(EngFunc_RemoveEntity, ent) start[0] = floatround(fstart[0]) start[1] = floatround(fstart[1]) start[2] = floatround(fstart[2]) new Float:lstart[3] lstart[0] = fstart[0] lstart[1] = fstart[1] lstart[2] = fstart[2] set_task(1.5,"stopthehit",9988) if(is_origin_outside(lstart)) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( TE_BEAMPOINTS ); write_coord( start[ 0 ] ); write_coord( start[ 1 ] ); write_coord( start[ 2 ] + 2000); write_coord( start[ 0 ] + 30); write_coord( start[ 1 ] ); write_coord( start[ 2 ] ); write_short( sprte ); write_byte( 1 ); write_byte( 5 ); write_byte( 7 ); write_byte( 40 ); write_byte( 10 ); write_byte( 0 ); write_byte( 200 ); write_byte( 200 ); write_byte( 200 ); write_byte( 200 ); message_end(); message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( TE_BEAMPOINTS ); write_coord( start[ 0 ] ); write_coord( start[ 1 ] ); write_coord( start[ 2 ] + 2000); write_coord( start[ 0 ] - 30); write_coord( start[ 1 ] ); write_coord( start[ 2 ] ); write_short( sprte ); write_byte( 1 ); write_byte( 5 ); write_byte( 7 ); write_byte( 40 ); write_byte( 10 ); write_byte( 0 ); write_byte( 200 ); write_byte( 200 ); write_byte( 200 ); write_byte( 200 ); message_end(); message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( TE_BEAMPOINTS ); write_coord( start[ 0 ] ); write_coord( start[ 1 ] ); write_coord( start[ 2 ] + 2000); write_coord( start[ 0 ] ); write_coord( start[ 1 ] - 30); write_coord( start[ 2 ] ); write_short( sprte ); write_byte( 1 ); write_byte( 5 ); write_byte( 7 ); write_byte( 40 ); write_byte( 10 ); write_byte( 0 ); write_byte( 200 ); write_byte( 200 ); write_byte( 200 ); write_byte( 200 ); message_end(); message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( TE_BEAMPOINTS ); write_coord( start[ 0 ] ); write_coord( start[ 1 ] ); write_coord( start[ 2 ] + 2000); write_coord( start[ 0 ] ); write_coord( start[ 1 ] + 30); write_coord( start[ 2 ] ); write_short( sprte ); write_byte( 1 ); write_byte( 5 ); write_byte( 7 ); write_byte( 40 ); write_byte( 10 ); write_byte( 0 ); write_byte( 200 ); write_byte( 200 ); write_byte( 200 ); write_byte( 200 ); message_end(); message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte(TE_BEAMCYLINDER) write_coord(start[0]) // start X write_coord(start[1]) // start Y write_coord(start[2]) // start Z write_coord(start[0]) // something X write_coord(start[1]) // something Y write_coord(start[2] + 300) // something Z write_short(Shockwave) // sprite write_byte(0) // startframe write_byte(0) // framerate write_byte(8) // life write_byte(150) // width write_byte(0) // noise write_byte(0) // red write_byte(100) // green write_byte(250) // blue write_byte(150) // brightness write_byte(0) // speed message_end(); message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte(TE_SPRITETRAIL) // line of moving glow sprites with gravity, fadeout, and collisions write_coord(start[0]) write_coord(start[1]) write_coord(start[2]) write_coord(start[0]) write_coord(start[1]) write_coord(start[2] + 200) write_short(BlueFlare) // (sprite index) write_byte(250) // (count) write_byte(random_num(27,30)) // (life in 0.1's) write_byte(1) // byte (scale in 0.1's) write_byte(random_num(30,70)) // (velocity along vector in 10's) write_byte(40) // (randomness of velocity in 10's) message_end(); message_begin(MSG_BROADCAST, SVC_TEMPENTITY, start) write_byte(TE_EXPLOSION) write_coord(start[0]) write_coord(start[1]) write_coord(start[2]) write_short(g_Explosion) write_byte(30) write_byte(15) write_byte(0) message_end() emit_sound(0,CHAN_AUTO, "weapons/mine_charge.wav", 1.0, ATTN_NORM, SND_STOP, PITCH_NORM) emit_sound(0,CHAN_AUTO, "weapons/explode4.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) new Players[32] new playerCount, i, player get_players(Players, playerCount, "ac") for (i=0; i<playerCount; i++) { player = Players[i] static Float:porigin[3]; static Float:stOrigin[3]; pev(player,pev_origin,porigin); stOrigin[0] = float(start[0]) stOrigin[1] = float(start[1]) stOrigin[2] = float(start[2]) new Float:pdist = get_distance_f(porigin,stOrigin) if(pdist < 1000.0) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenShake"), {0,0,0}, player) // Shake Screen write_short(255<<14) //ammount write_short(10<<14) //lasts this long write_short(255<<14) //frequency message_end() } if(pdist < 1000.0 && pdist > 750.0) { new Float:aferiin = random_float(150.0,320.0) if(get_user_health(player) > floatround(aferiin)) { fakedamage(player,"Satellite Cannon",aferiin,DMG_ENERGYBEAM) } else { fm_user_silentkill(player,1) make_deathmsg(powner,player,0,"Satellite Cannon") if(fm_get_user_team(player) == fm_get_user_team(powner)) { set_pev(powner,pev_frags,pev(powner,pev_frags) - 1.0) } else { set_pev(powner,pev_frags,pev(powner,pev_frags) + 1.0) } } } else if(pdist < 750.0) { new Float:kocamanac = random_float(150.0,320.0) if(get_user_health(player) > floatround(kocamanac)) { fakedamage(player,"Satellite Cannon",kocamanac,DMG_ENERGYBEAM) } else { fm_user_silentkill(player,1) make_deathmsg(powner,player,0,"Satellite Cannon") set_pev(powner,pev_frags,pev(powner,pev_frags) + 1.0) } } } shock[powner] = false; } else { set_hudmessage(85, 255, 0, 0.6, 0.50, 0, 6.0, 10.0) show_hudmessage(0, "INFO : Bomba nie moze wybuchnac w pomieszczeniu !") shock[powner] = false; } } } return PLUGIN_HANDLED } public ElectroBuy(id) { if((fm_cs_get_user_money(id) < get_pcvar_num(cvar_elektrocost)) || (!is_user_alive(id)) || shock[id]) return PLUGIN_HANDLED; fm_cs_set_user_money(id,fm_cs_get_user_money(id) - get_pcvar_num(cvar_elektrocost)) set_hudmessage(85, 255, 0, 0.6, 0.50, 0, 6.0, 10.0) show_hudmessage(id, "INFO : Aby bomba wybuchla musisz ja wyrzucic na powietrzu ! ^nW pomieszczeniu nie wybuchnie") shock[id] = true; cod_give_weapon(id,CSW_SMOKEGRENADE) return PLUGIN_HANDLED; } public NuclearBuy(id) { if((fm_cs_get_user_money(id) < get_pcvar_num(cvar_nuclearcost)) || (!is_user_alive(id)) || atombomb[id]) return PLUGIN_HANDLED; fm_cs_set_user_money(id,fm_cs_get_user_money(id) - get_pcvar_num(cvar_nuclearcost)) client_print(id,print_center,"Polaczony z Silami Powietrznymi.") client_print(id,print_center,"Przytrzymaj klawisz F aby wezwac Nalot Powietrzny !") client_cmd(id,"bind f +calling") atombomb[id] = true; return PLUGIN_HANDLED; } public CallAir(id) { if(is_user_alive(id) && atombomb[id] && nuclearReady) { if(!is_user_outside(id)) { ColorChat(id, RED, "[COD:MW3] ^x01Nie mozesz wezwac ^x03Nalotu Powietrzengo ^x01bedac w pomieszczeniu !!") return PLUGIN_HANDLED; } pCalling[id] = true; set_task(1.0,"imhere",id + 4747,"",0,"a",9) ProgressBar(id,8,0) } return PLUGIN_HANDLED } public CallIptal(id) { pCalling[id] = false; callAttemps[id] = 0; ProgressBar(id,0,0) remove_task(id + 4747) } public imhere(TaskId) { new id = TaskId - 4747; if(!pCalling[id] || !nuclearReady || !is_user_outside(id)) { remove_task(TaskId) callAttemps[id] = 0; ProgressBar(id,0,0) return PLUGIN_HANDLED; } if(callAttemps[id] < 8) { callAttemps[id] += 1; } if(callAttemps[id] == 8 ) { NukleerSaldiri(id) } return PLUGIN_HANDLED } public NukleerSaldiri(id) { if(!is_user_alive(id) || !atombomb[id]) return PLUGIN_HANDLED; if(!nuclearReady) { client_print(id,print_center,"Jestesmy w pelni gotowi ! Zaraz tam bedziemy .") return PLUGIN_HANDLED; } atombomb[id] = false; nuclearReady = false; stCommander = id; set_hudmessage(85, 255, 0, 0.2, 0.79, 0, 6.0, 5.0) show_hudmessage(0, "UWAGA : Nalot powietrzny nadlatuje !") emit_sound(0,CHAN_AUTO, "ambience/siren.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) set_task(5.0,"comingg",1453) set_task(100.0,"ncReady",3333) return PLUGIN_HANDLED; } public comingg(TaskID) { emit_sound(0,CHAN_AUTO, "ambience/siren.wav", 1.0, ATTN_NORM, SND_STOP, PITCH_NORM) emit_sound(0,CHAN_AUTO, "ambience/jetflyby1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) set_task(8.0,"wohoo",1071) set_task(6.0,"falling",2011) remove_task(1453) } public falling(TaskID) { emit_sound(0,CHAN_AUTO, "ambience/jetflyby1.wav", 1.0, ATTN_NORM, SND_STOP, PITCH_NORM) emit_sound(0,CHAN_AUTO, "weapons/mortar.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) remove_task(2011) } public wohoo(TaskID) { new Players[32] new playerCount, i, player get_players(Players, playerCount, "a") for (i=0; i<playerCount; i++) player = Players[i] emit_sound(0,CHAN_AUTO, "weapons/mortar.wav", 1.0, ATTN_NORM, SND_STOP, PITCH_NORM) emit_sound(0,CHAN_AUTO, "weapons/mortarhit.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},player) write_short(1<<9999) // fade lasts this long duration write_short(1<<9999) // fade lasts this long hold time write_short(1<<999) // fade type (in / out) write_byte(255) // fade red write_byte(255) // fade green write_byte(255) // fade blue write_byte(255) // fade alpha message_end() if(is_user_outside(player)) { fm_user_silentkill(player,1) make_deathmsg(stCommander,player,0,"Nuclear Bomb") if(fm_get_user_team(player) == fm_get_user_team(stCommander)) { set_pev(stCommander,pev_frags,pev(stCommander,pev_frags) - 1.0) } else { set_pev(stCommander,pev_frags,pev(stCommander,pev_frags) + 1.0) } } remove_task(1071) stCommander = 0 set_task(5.0,"stopit",2222) } public stopit(TaskID) { emit_sound(0,CHAN_AUTO, "weapons/mortarhit.wav", 1.0, ATTN_NORM, SND_STOP, PITCH_NORM) remove_task(2222) } public ncReady(TaskID) { nuclearReady = true; } stock Float:is_user_outside(id) { new Float:origin[3], Float:dist pev(id, pev_origin, origin) dist = origin[2] while(engfunc(EngFunc_PointContents, origin) == CONTENTS_EMPTY) origin[2] += 5.0 if(engfunc(EngFunc_PointContents, origin) == CONTENTS_SKY) return (origin[2] - dist) return 0.0 } stock Float:is_origin_outside(Float:origin[3]) { new Float:dist dist = origin[2] while(engfunc(EngFunc_PointContents, origin) == CONTENTS_EMPTY) origin[2] += 5.0 if(engfunc(EngFunc_PointContents, origin) == CONTENTS_SKY) return (origin[2] - dist) return 0.0 } stock ProgressBar(id, seconds, position) { message_begin(MSG_ONE, get_user_msgid("BarTime"), {0, 0, 0}, id) write_byte(seconds) write_byte(position) message_end() } stock fm_cs_set_user_money(id,money,flash=1) { set_pdata_int(id,OFFSET_CSMONEY,money,OFFSET_LINUX); message_begin(MSG_ONE,get_user_msgid("Money"),{0,0,0},id); write_long(money); write_byte(flash); message_end(); } stock fm_cs_get_user_money(id) { return get_pdata_int(id,OFFSET_CSMONEY,OFFSET_LINUX); } stock give_item(index, const item[]) { if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10)) return 0 new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item)) if (!pev_valid(ent)) return 0 new Float:origin[3] pev(index, pev_origin, origin) set_pev(ent, pev_origin, origin) set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN) dllfunc(DLLFunc_Spawn, ent) new save = pev(ent, pev_solid) dllfunc(DLLFunc_Touch, ent, index) if (pev(ent, pev_solid) != save) return ent engfunc(EngFunc_RemoveEntity, ent) return -1 } stock fm_user_silentkill(index,flag=1) { new msgid = get_user_msgid("DeathMsg") new msgblock = get_msg_block(msgid) if(msgblock==BLOCK_NOT) { set_msg_block(msgid,BLOCK_ONCE) user_kill(index,flag) } else if(msgblock==BLOCK_ONCE) { user_kill(index,flag) set_msg_block(msgid,BLOCK_ONCE) } else { user_kill(index,flag) } return 1 } public charging(TaskID) { emit_sound(0,CHAN_AUTO, "weapons/mine_charge.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) remove_task(TaskID) } public stopthehit(TaskID) { emit_sound(0,CHAN_AUTO, "weapons/explode4.wav", 1.0, ATTN_NORM, SND_STOP, PITCH_NORM) remove_task(TaskID) } stock CsTeams:fm_get_user_team(id) return CsTeams:get_pdata_int(id, 114)