PHP- Kodu:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <colorchat>
#define PLUGIN "CSP Rocket Menu"
#define VERSION "1.2"
#define AUTHOR "Mlhcnshn"
#define ROCKET 10 // Hangi degeri girer iseniz rocket saniyeleri o degerin katlarinda olacaktir. Ornek: 8/16/24/32/40/48
#define REKLAM "^3[^DarkHawks Gaming^3]"
new g_iMsgDamage;new g_iSmokeSpr, g_iWhiteSpr, g_iBlueflare2Spr, g_iMflashSpr;
new rocketsure;
new bool:rocketkontrol;
new map[33];
public plugin_init() { get_mapname(map,32); if((containi(map,"jail") == -1) && (containi(map,"jb_") == -1)) return register_plugin(PLUGIN, VERSION, AUTHOR) register_logevent( "YeniEL", 2, "1=Round_Start" ); register_clcmd("say /rocket","RoketAt") g_iMsgDamage = get_user_msgid("Damage");}public plugin_precache() { precache_sound("csp_rocket/10saniye.wav") precache_sound("csp_rocket/9saniye.wav") precache_sound("csp_rocket/8saniye.wav") precache_sound("csp_rocket/7saniye.wav") precache_sound("csp_rocket/6saniye.wav") precache_sound("csp_rocket/5saniye.wav") precache_sound("csp_rocket/4saniye.wav") precache_sound("csp_rocket/3saniye.wav") precache_sound("csp_rocket/2saniye.wav") precache_sound("csp_rocket/1saniye.wav") precache_sound("csp_rocket/0saniye.wav") } public YeniEL(){ rocketkontrol = false;}
public RoketAt(id){ if(get_user_team(id) != 2) { ColorChat(0,GREEN,"%s ^4Bu menuye sadece ^1CT^4'ler Erisebilir.", REKLAM); return PLUGIN_HANDLED; } static Item[64] formatex(Item, charsmax(Item),"\r[\wDarkHawks Gaming\r]\r // \wRocket Menusu") new Menu = menu_create(Item, "RocketDevam") if(!rocketkontrol) { formatex(Item, charsmax(Item),"\rRocket At \d(\y %d Saniye \d)",ROCKET) menu_additem(Menu, Item, "1") formatex(Item, charsmax(Item),"\rRocket At \d(\y %d Saniye \d)",ROCKET+ROCKET) menu_additem(Menu, Item, "2") formatex(Item, charsmax(Item),"\rRocket At \d(\y %d Saniye \d)",ROCKET+(ROCKET*2)) menu_additem(Menu, Item, "3") formatex(Item, charsmax(Item),"\rRocket At \d(\y %d Saniye \d)",ROCKET+(ROCKET*3)) menu_additem(Menu, Item, "4") formatex(Item, charsmax(Item),"\rRocket At \d(\y %d Saniye \d)",ROCKET+(ROCKET*4)) menu_additem(Menu, Item, "5") formatex(Item, charsmax(Item),"\rRocket At \d(\y %d Saniye \d)",ROCKET+(ROCKET*5)) menu_additem(Menu, Item, "6") } else { formatex(Item, charsmax(Item),"\rRocket \yDurdur ^n\dSu Anda Geri Sayim Yapiliyor!") menu_additem(Menu, Item, "7") } formatex(Item, charsmax(Item), "\yCikis") menu_setprop(Menu,MPROP_EXITNAME,Item) menu_display(id, Menu,0) return PLUGIN_HANDLED;}
public RocketDevam(id, menu, item){ if( item == MENU_EXIT ) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], iName[64]; new access, callback; menu_item_getinfo(menu, item, access, data,5, iName, 63, callback); new name[32]; get_user_name(id,name,31); new key = str_to_num(data); if(key != 7) log_amx("[DarkHawks Gaming] %s Isimli CT Rocket Menuyu Kullandi.",name) switch(key) { case 1: { rocketkontrol = true; rocketsure = ROCKET Cmd_Rocket(id); } case 2: { rocketkontrol = true; rocketsure = ROCKET + ROCKET; Cmd_Rocket(id); } case 3: { rocketkontrol = true; rocketsure = ROCKET+(ROCKET*2); Cmd_Rocket(id); } case 4: { rocketkontrol = true; rocketsure = ROCKET+(ROCKET*3); Cmd_Rocket(id); } case 5: { rocketkontrol = true; rocketsure = ROCKET+(ROCKET*4); Cmd_Rocket(id); } case 6: { rocketkontrol = true; rocketsure = ROCKET+(ROCKET*5) Cmd_Rocket(id); } case 7: { new name[32]; get_user_name(id,name,31); if(rocketkontrol && rocketsure > 0) { rocketkontrol = false; ColorChat(0,GREEN,"%s ^4Rocket^1 %s ^4isimli CT tarafindan^1 DURDURULDU^4!",REKLAM, name); } else if(!rocketsure) { ColorChat(id,GREEN,"%s ^4Rocket Atildigi Icin ^1Durdurulamiyor^4!", REKLAM); return PLUGIN_HANDLED; } } } menu_destroy(menu); return PLUGIN_HANDLED;}
new g_iRocketZAxis[33];
public Cmd_Rocket(id){ if(!rocketkontrol) { return PLUGIN_HANDLED; } if(rocketsure < 0) { rocketkontrol = false; new iTempid; new iPlayers[32], iPlayerNum; get_players(iPlayers, iPlayerNum, "ae", "TERRORIST"); if(!iPlayerNum) { console_print(id, "[DarkHawks Gaming] Terorist Bulunmamakta!"); return PLUGIN_HANDLED; } for(new i = 0; i < iPlayerNum; i++) { iTempid = iPlayers[i]; if(get_user_team(iTempid) != 1 && !is_user_alive(iTempid)) { continue; } emit_sound(iTempid, CHAN_WEAPON , "weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM); set_user_maxspeed(iTempid,0.01); set_task(1.2, "Roketle" , iTempid); } } else if(rocketsure == 0) { client_cmd(0,"spk csp_rocket/%dsaniye.wav",rocketsure); ColorChat(0,GREEN,"%s ^4Rocket ATILIYOR!", REKLAM, rocketsure--); set_task(0.5,"Cmd_Rocket", id); } else if(rocketsure <= 10) { client_cmd(0,"spk csp_rocket/%dsaniye.wav",rocketsure); ColorChat(0,GREEN,"%s Rocketin Atilmasina Son^4 %d ^3Saniye Kaldi!", REKLAM, rocketsure--); set_task(1.0,"Cmd_Rocket", id); } else if(rocketsure > 0) { ColorChat(0,GREEN,"%s Rocketin Atilmasina Son^4 %d ^3Saniye Kaldi!", REKLAM, rocketsure--); set_task(1.0,"Cmd_Rocket", id); } return PLUGIN_HANDLED;}
public Roketle(iVictim){ if(!is_user_alive(iVictim)) return; set_user_gravity(iVictim, -0.50); client_cmd(iVictim, "+jump;wait;wait;-jump"); emit_sound(iVictim, CHAN_VOICE, "weapons/rocket1.wav", 1.0, 0.5, 0, PITCH_NORM); rocket_effects(iVictim);}
public rocket_effects(iVictim){ if(!is_user_alive(iVictim)) return; new iOrigin[3]; get_user_origin(iVictim,iOrigin); message_begin(MSG_ONE, g_iMsgDamage, {0,0,0}, iVictim); write_byte(30); write_byte(30); write_long(1<<16); write_coord(iOrigin[0]); write_coord(iOrigin[1]); write_coord(iOrigin[2]); message_end(); if(g_iRocketZAxis[iVictim] == iOrigin[2]) rocket_explode(iVictim); g_iRocketZAxis[iVictim] = iOrigin[2]; message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(15); write_coord(iOrigin[0]); write_coord(iOrigin[1]); write_coord(iOrigin[2]); write_coord(iOrigin[0]); write_coord(iOrigin[1]); write_coord(iOrigin[2] - 30); write_short(g_iBlueflare2Spr); write_byte(5); write_byte(1); write_byte(1); write_byte(10); write_byte(5); message_end(); message_begin(MSG_BROADCAST,SVC_TEMPENTITY); write_byte(17); write_coord(iOrigin[0]); write_coord(iOrigin[1]); write_coord(iOrigin[2] - 30); write_short(g_iMflashSpr); write_byte(15); write_byte(255); message_end(); set_task(0.2, "rocket_effects", iVictim);}
public rocket_explode(iVictim){ if(is_user_alive(iVictim)) { new iOrigin[3]; get_user_origin(iVictim, iOrigin); message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iOrigin); write_byte(21); write_coord(iOrigin[0]); write_coord(iOrigin[1]); write_coord(iOrigin[2] - 10); write_coord(iOrigin[0]); write_coord(iOrigin[1]); write_coord(iOrigin[2] + 1910); write_short(g_iWhiteSpr); write_byte(0); write_byte(0); write_byte(2); write_byte(16); write_byte(0); write_byte(188); write_byte(220); write_byte(255); write_byte(255); write_byte(0); message_end(); message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(12); write_coord(iOrigin[0]); write_coord(iOrigin[1]); write_coord(iOrigin[2]); write_byte(188); write_byte(10); message_end(); message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iOrigin); write_byte(5); write_coord(iOrigin[0]); write_coord(iOrigin[1]); write_coord(iOrigin[2]); write_short(g_iSmokeSpr); write_byte(2); write_byte(10); message_end(); user_kill(iVictim, 1); } emit_sound(iVictim, CHAN_VOICE, "weapons/rocket1.wav", 0.0, 0.0, (1<<5), PITCH_NORM); set_user_maxspeed(iVictim, 1.0); set_user_gravity(iVictim, 1.00);}