Guardian Menu - Furkan Dize - 04-11-12
PHP Code: ///////////////////////////////////////////////////////////////////////////// //============================== //= Jailbreak Guards Menu = //============================== // //--------------------- //- Description - //--------------------- // //This menu include the features: //** FriendlyFire Menu (Turn ON or OFF the FF) //** Gravity Menu (Turn ON or OFF the GRAVITY [default: ON = 300 | OFF = 800]) //** CantPick Weapons Menu (Turn ON or OFF if Terrorists can pick weapons from the ground) //** NadeWars (Strip all weapons from terrorist and give 300 (default value) HE's //CTs HP has set 5000 (default value)) //** Open Cells (Open all the prisioners cells) //** Divide Terrorist Team in two separate teams by glow color //** Equation Games (Random Equation pop up and the first to type in the chat the right answer will be win) //** Countdown System //** ReAmmo System //** FirstWrites System // //---------------------- //- Requirements - //---------------------- // //** AMXX: Version 1.8.1 //** AMXX Modules: Cstrike, Fun, Engine, Fakemeta and Hamsandwich modules // //---------------------- //- Installation - //---------------------- // //1- Download and compile the plugin from: //2- Upload the amxx file to your server (cstrike>addons>amxmodx>plugins). //3- Edit the config file and add the plugin (cstrike>addons>amxmodx>configs>plugins.ini). // //---------------------- //- Suggestions - //---------------------- // //If you want suggest any new option for add to the menu visit: //https://forums.alliedmods.net/showthread.php?t=190894 // //---------------------- //- Contact Info - //---------------------- // //For reporting bugs or post your feedback visit: //https://forums.alliedmods.net/showthread.php?p=1756887 // //If you want some private job pm me on alliedmodders forum's or send me and email to: //[email protected] // //----------------- //- Credits - //----------------- // //** Freestyle //- Main/Inicial Code // //** Pastout //- Divide Terrorist team in two system // //** xDrugz //- FirstWrite a Number System // //** fraglider91 //- Fix Bugs & Optimize Code // //------------------ //- Updates Logs - //------------------ // //** v1.0 [Jul 2012] //- Added Original Options. // //** v1.1 [Jul 2012] //- Added Divide in two system // //** v1.2 [Jul 2012] //- Added Equation System // //** v1.3 [Jul 2012] //- Added CountDown System //- Optimize Code // //** v1.4 [Jul 2012] //- Added ReAmmo System //- Added FirstWrites System //- Optimize Code // //** v1.5 [Aug 2012] //- Clean code //- Correct Bugs // //** v1.6 [Sep 2012] //- Optimize All code //- Correct Small Bugs // ////////////////////////////////////////////////////////////////////
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #include <fun> #include <fakemeta> //#include <fakemeta_util> #include <engine>
// PLUGIN INFO #define PLUGIN "Jailbreak Guard Menu" #define VERSION "1.6" #define AUTHOR "Freestyle"
// PREFIX #define PREFIX "Community Tag"
// Options Menu new g_iGravity, g_iCT_Health, g_iHE_Amount;
new bool: allow_gun[33], bool: g_FF[33], bool: g_Gravity[33], bool: g_bTeamDivided, bool: g_CantPick[33];
// Equation System const gEquationAmount = 5; new gChosenEquation;
new bool:gEquationON;
new gRandomEquations[gEquationAmount][] = { "1 + 1 = ?", "2x + 6 = 0, what is x?", "x^2 + 4x + 4 = 0, what is x?", "52 + 35 = ?", "38 + 12 = ?" }
new gAnswers[gEquationAmount][] = { "2", "-3", "2", "87", "50" }
// Weapons Stuff #define IsPrimaryWeapon(%1) ((1<<%1) & PRIMARY_WEAPONS_BIT) #define IsSecondaryWeapon(%1) ((1<<%1) & PISTOL_WEAPONS_BIT) #define MAX_WEAPON CSW_P90
new const g_iMaxBPAmmo[MAX_WEAPON + 1] = { 0, 52, 0, 90, 1, 32, 0, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100 }
new g_iPrimaryWeapon[33], g_iSecondaryWeapon[33];
// CountDown System new g_iSyncHud, g_CDSAY[33], g_TaskCountdown;
// FirstWrite System new g_FWCount, g_fwActive = false, g_fwAllowMove = false, g_CountVoice[21], g_MixChars[6], g_LastChars[6]; new const TASKID = 2502502; new bool: g_FW[33];
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR);
// Commands // register_clcmd("say /ctmenu", "menu_jailbreakguard"); register_clcmd("say", "cmdSay");
// Events & Ham // RegisterHam(Ham_TraceAttack, "func_button", "useButton"); RegisterHam(Ham_Spawn, "player", "Event_Playerspawn", 1); register_event("CurWeapon", "Event_CurWeapon", "be", "1=1"); register_logevent("Event_Round", 3, "1=RoundStart", "2=RoundEnd"); // ** CVARS ** // // Gravity // g_iGravity = register_cvar("amount_of_gravity", "300"); // NadeWars // g_iCT_Health = register_cvar("amount_of_hp", "5000"); g_iHE_Amount = register_cvar("amount_of_he", "300"); }
public Event_Playerspawn(id) { if(is_user_alive(id)) { set_user_gravity(id); } }
////////////////////////////////////////////// //------------WEAPON BLOCKER----------------// ////////////////////////////////////////////// public Event_CurWeapon(id) { if(allow_gun[id]) { return PLUGIN_CONTINUE; } return PLUGIN_CONTINUE; }
////////////////////////////////////////////// // Equation System // ////////////////////////////////////////////// public equation_game_start() { gEquationON = true; gChosenEquation = random_num(0, gEquationAmount - 1); set_hudmessage(255, 255, 255, -1.0, 0.35, 0, 6.0, 10.0, 0.1, 0.2, 4); show_hudmessage(0, "[%s]^nFirst one to answer the equation correctly wins that Game:^n%s", PREFIX, gRandomEquations[gChosenEquation]); return PLUGIN_CONTINUE; }
public Event_Round() { gEquationON = false; }
public cmdSay(id, player) { if(!gEquationON) { return PLUGIN_CONTINUE; } new args[256]; read_args(args, 255); if(equal(args, gAnswers[gChosenEquation])) { new szName[32]; get_user_name(id, szName, charsmax(szName)); client_print(id, print_chat, "%s correctly answered the equation first. He wins!", szName); } new szMessage[32]; read_args(szMessage, charsmax(szMessage)); remove_quotes(szMessage); if(g_fwAllowMove && get_user_team(player) != 1) { ColorChat(player, "Only^4 Prisoners^1 May Participate !"); return PLUGIN_HANDLED; } if(equali(szMessage, g_LastChars)) { if(g_fwAllowMove) { if(!is_user_connected(player) || !is_user_alive(player)) { ColorChat(player, "You Must Be^4 Alive^1 !"); return PLUGIN_HANDLED; } new szWinner[32]; get_user_name(player, szWinner, charsmax(szWinner)); set_hudmessage(255, 255, 255, -1.0, 0.30, 0, 4.0, 4.0); show_hudmessage(0, "%s, is the Winner !", szWinner); client_cmd(player, "spk holo/tr_holo_nicejob"); g_fwAllowMove = false; g_fwActive = false; } } else { if(g_fwAllowMove) { client_cmd(player, "spk scientist/completelywrong"); } } return PLUGIN_CONTINUE; }
//==================================================== //Main Menu //====================================================
public menu_jailbreakguard(id) { if(!is_user_alive(id)) { return; } if(cs_get_user_team(id) == CS_TEAM_CT) { static Item[64]; formatex(Item, charsmax(Item), "\yGuards Menu"); new Menu = menu_create(Item, "menu_jailbreakguard_main"); formatex(Item, charsmax(Item), "\wFriendlyFire \y(\r%s\y)", g_FF[id] == true ? "ON" : "OFF"); menu_additem(Menu, Item, "1"); formatex(Item, charsmax(Item), "\wGravity \y(\r%s\y)", g_Gravity[id] == true ? "ON" : "OFF"); menu_additem(Menu, Item, "2"); formatex(Item, charsmax(Item), "\wCantPick \y(\r%s\y)", g_CantPick[id] == true ? "Actived" : "Desactived"); menu_additem(Menu, Item, "3"); formatex(Item, charsmax(Item), "\wNadeWars \dSpecial Day"); menu_additem(Menu, Item, "4"); formatex(Item, charsmax(Item), "\wDivide Prisioners in 2"); menu_additem(Menu, Item, "5"); formatex(Item, charsmax(Item), "\wEquation Game"); menu_additem(Menu, Item, "6"); formatex(Item, charsmax(Item), "\wOpen Cells"); menu_additem(Menu, Item, "7"); formatex(Item, charsmax(Item), "\wRe-Ammo"); menu_additem(Menu, Item, "8"); formatex(Item, charsmax(Item), "\wFirstWrite \y(\r%s\y)", g_FW[id] == true ? "Started" : "Stopped"); menu_additem(Menu, Item, "9"); menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, Menu, 0); } else { client_print(id, print_chat, "[%s] You are not a Guard.", PREFIX); } }
public menu_jailbreakguard_main(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 key = str_to_num(data); switch(key) { case 1: { if(!g_FF[id]) { g_FF[id] = true; if(g_FF[id]) { server_cmd("mp_friendlyfire 1"); set_hudmessage(random_num(1, 255), random_num(1, 255), random_num(1, 255), -1.0, -1.0, 0, 6.0, 12.0); show_hudmessage(0, "[%s]^n= FriendlyFire Online =", PREFIX); } } else { g_FF[id] = false; server_cmd("mp_friendlyfire 0"); set_hudmessage(random_num(1, 255), random_num(1, 255), random_num(1, 255), -1.0, -1.0, 0, 6.0, 12.0); show_hudmessage(0, "[%s]^n= FriendlyFire Offline =", PREFIX); } } case 2: { if(!g_Gravity[id]) { g_Gravity[id] = true; if(g_Gravity[id]) { server_cmd("sv_gravity %s", get_pcvar_num(g_iGravity)); set_hudmessage(random_num(1, 255), random_num(1, 255), random_num(1, 255), -1.0, -1.0, 0, 6.0, 12.0); show_hudmessage(0, "[%s]^n= Gravity Online =", PREFIX); } } else { g_Gravity[id] = false; server_cmd("sv_gravity 800"); set_hudmessage(random_num(1, 255), random_num(1, 255), random_num(1, 255), -1.0, -1.0, 0, 6.0, 12.0); show_hudmessage(0, "[%s]^n= Gravity Offline =", PREFIX); } } case 3: { if(!g_CantPick[id]) { g_CantPick[id] = true; if(g_CantPick[id]) { cant_pick_on(id); } } else { g_CantPick[id] = false; cant_pick_off(id); } } case 4: nadewars(id); case 5: dividein2(id); case 6: equation_game_start(); case 7: open_cells(id); case 8: reammo(id); case 9: { if(!g_FW[id]) { g_FW[id] = true; if(g_FW[id]) { set_task(0.1, "fnFwStart"); } } else { g_FW[id] = false; set_task(0.1, "fnFwStop"); } } } return PLUGIN_HANDLED; }
//==================================================== //NadeWars System //==================================================== public nadewars(id) { if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T) { strip_user_weapons(id); give_item(id, "weapon_hegrenade"); cs_set_user_bpammo(id, CSW_HEGRENADE, get_pcvar_num(g_iHE_Amount)); set_hudmessage(random_num(1, 255), random_num(1, 255), random_num(1, 255), -1.0, -1.0, 0, 6.0, 12.0); show_hudmessage(0, "[%s]^n= Nadewars start! The last Prisoner will be win! =", PREFIX); } else { set_user_health(id, get_pcvar_num(g_iCT_Health)); } }
//==================================================== //Open Cells System //==================================================== public open_cells(id) { new szGuardName[32]; get_user_name(id, szGuardName, charsmax(szGuardName)); set_hudmessage(random_num(1, 255), random_num(1, 255), random_num(1, 255), -1.0, -1.0, 0, 6.0, 12.0); show_hudmessage(0, "[%s]^n= Guard %s open the cells =", PREFIX, szGuardName); while(engfunc(EngFunc_FindEntityByString, -1, "classname", "func_door")) { dllfunc(DLLFunc_Use, -1, 0); } }
public client_PreThink(client) { if(entity_get_int(client, EV_INT_button) & IN_ATTACK && entity_get_int(client, EV_INT_button) & IN_USE) { user_silentkill(client); client_print(client, print_center, "You Died Due to Using Game Bug!"); } }
public useButton(iEnt, iAttacker, Float:fDamage, Float:vDirection[3], TraceHandle, iDamageBits) { if(cs_get_user_team(iAttacker) != CS_TEAM_CT) { return HAM_IGNORED; } dllfunc(DLLFunc_Use, iEnt, iAttacker); return HAM_IGNORED; }
//==================================================== //CantPick System //==================================================== public cant_pick_off(id) { new iNum; for(new i = 0; i < iNum; i++) { if(cs_get_user_team(id) == CS_TEAM_T) { allow_gun[i] = true; set_hudmessage(random_num(1, 255), random_num(1, 255), random_num(1, 255), -1.0, -1.0, 0, 6.0, 12.0); show_hudmessage(0, "[%s]^n= Cant Pick Weapons Offline =", PREFIX); } } }
public cant_pick_on(id) { new iNum; for(new i = 0; i < iNum; i++) { if(cs_get_user_team(id) == CS_TEAM_T) { allow_gun = false; set_hudmessage(random_num(1, 255), random_num(1, 255), random_num(1, 255), -1.0, -1.0, 0, 6.0, 12.0); show_hudmessage(0, "[%s]^n= Cant Pick Weapons Online =", PREFIX); } } }
//==================================================== //DivideIn2 System (Credits to Pastout) //==================================================== public dividein2(id) { static iNum, iPlayers[32], iPlayer, i, Count; Count = 0; get_players(iPlayers, iNum, "ae", "TERRORIST"); new szName[32]; get_user_name(id, szName, charsmax(szName)); for(i = 0; i < iNum; i++) { iPlayer = iPlayers; Count++; } new iExtraPlayers = Count % 2; if(iExtraPlayers) { client_print(id, print_chat, "[%s] Cannot Divide the Team due to odd number of Prisoners", PREFIX); } else if(g_bTeamDivided) { for(i = 0; i < iNum; i++) { iPlayer = iPlayers; set_user_rendering(iPlayer, _, 0, 0, 0, _, 0); } g_bTeamDivided = false; client_print(id, print_chat, "[%s] The Teams have been unglowed!", PREFIX); } else { for(new maxPerTeam = (iNum / 2), g_iTeams[2], g_iTeam, iPlayer, i = 0; i < iNum; i++) { iPlayer = iPlayers; g_iTeam = random_num(0, 1); if(g_iTeams[g_iTeam] >= maxPerTeam) { g_iTeam = !g_iTeam; } else { g_iTeams[g_iTeam]++ } if(g_iTeam == 1) { set_user_rendering(iPlayer, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16); } if(g_iTeam == 0) { set_user_rendering(iPlayer, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 16); } } client_print(0, print_chat, "[%s] Guard %s has Divided Prisoners into two Teams", PREFIX, szName); g_bTeamDivided = true; } }
//===================================================== //Count Down System //===================================================== public Countdown(id) { if(task_exists(g_TaskCountdown)) { client_print(id, print_chat, "[%s] Already have one countdown in progress.", PREFIX); } else { g_CDSAY[id] = true; client_cmd(id, "messagemode _countdown_"); client_print(id, print_chat, "[%s] Write how many seconds you want for the countdown.", PREFIX); } return PLUGIN_HANDLED; }
public MessageModeCountdown(id) { if(!g_CDSAY[id]) { return PLUGIN_HANDLED; } g_CDSAY[id] = false; new szArg[5]; read_args(szArg, charsmax(szArg)); remove_quotes(szArg); if(!szArg[0]) { return PLUGIN_HANDLED; } new Count; Count = str_to_num(szArg); TaskCountdown(Count + 1); set_task(1.0, "TaskCountdown", g_TaskCountdown, _, _, "a", Count); new szName[32]; get_user_name(id, szName, charsmax(szName)); set_hudmessage(255, 255, 100, 0.01, 0.35, 2); show_hudmessage(0, "[%s] Guard %s start the countdown!", PREFIX, szName); return PLUGIN_HANDLED; }
public TaskCountdown(iStartCount) { static Count; if(!Count && !task_exists(g_TaskCountdown)) { Count = iStartCount; } switch(Count--) { case 1: { ClearSyncHud(0, g_iSyncHud); client_cmd(0, "spk ^"radio/com_go.wav^""); } case 2..21: { new szTime[20]; num_to_word(Count, szTime, charsmax(szTime)); client_cmd(0, "spk ^"fvox/%s.wav^"", szTime); set_hudmessage(255, 255, 255, 0.5, 0.35, 1); ShowSyncHudMsg(0, g_iSyncHud, "%i", Count) } default: { set_hudmessage(255, 255, 255, 0.5, 0.35, 1); ShowSyncHudMsg(0, g_iSyncHud, "%i", Count); } } }
//===================================================== //ReAmmo System //===================================================== public reammo(id) { new iPrimary = g_iPrimaryWeapon[id]; new iSecondary = g_iSecondaryWeapon[id]; if(user_has_weapon(id, iPrimary)) { if(cs_set_user_bpammo(id, iPrimary, g_iMaxBPAmmo[iPrimary] == 0)) { cs_set_user_bpammo( id, iPrimary, g_iMaxBPAmmo[iPrimary]); } else { set_hudmessage(random_num(1, 255), random_num(1, 255), random_num(1, 255), -1.0, 0.01, 0, 6.0, 12.0); show_hudmessage(id, "[%s]^n= You dont have 0 bullets into your Weapon =", PREFIX); } } if(user_has_weapon(id, iSecondary)) { if(cs_set_user_bpammo(id, iPrimary, g_iMaxBPAmmo[iSecondary] == 0)) { cs_set_user_bpammo(id, iPrimary, g_iMaxBPAmmo[iSecondary]); } else { set_hudmessage(random_num(1, 255), random_num(1, 255), random_num(1, 255), -1.0, 0.01, 0, 6.0, 12.0); show_hudmessage(id, "[%s]^n= You dont have 0 bullets into your Weapon =", PREFIX); } } }
//===================================================== //FirstWrite a Number System (Credits to xDrugz) //===================================================== public fnFwStart(player) { if(!g_fwActive) { g_FWCount = 5; ActionTimer(); g_fwActive = true; } else { ColorChat(player, "^"^4First Writes^1^" Activity Already Started !"); } return PLUGIN_CONTINUE; }
public fnFwStop(player) { if(g_fwActive) { remove_task(TASKID); g_fwActive = false; g_fwAllowMove = false; ColorChat(0, "^"^4First Writes^1^" Activity Stopped !"); } return PLUGIN_CONTINUE; }
public ActionTimer() { switch(g_FWCount) { case 0: { g_fwAllowMove = true; formatex(g_MixChars, 4, "%i", random_num(0, 99999)); g_LastChars = g_MixChars; set_hudmessage(255, 255, 255, -1.0, 0.30, 0, 4.0, 4.0); show_hudmessage(0, "[%s]", g_LastChars); ColorChat(0, "Agreed Number is^4 %s^1 Hurry up !", g_LastChars); remove_task(TASKID); set_task(15.0, "ActionFailed", TASKID); } case 1..5: { set_task(1.0, "ActionTimer", TASKID); } } if(g_FWCount != 0) { num_to_word(g_FWCount, g_CountVoice, 20); client_cmd(0, "spk ^"vox/%s seconds^"", g_CountVoice); set_hudmessage(255, 255, 255, -1.0, 0.30, 0, 0.5, 0.5); show_hudmessage(0, "Start in %d Seconds !", g_FWCount); --g_FWCount; } }
public ActionFailed() { if(g_fwAllowMove) { set_hudmessage(255, 255, 255, -1.0, 0.30, 0, 4.0, 4.0); show_hudmessage(0, "First Writes Activity Failed !"); ColorChat(0, "^"^4First Writes^1^" Activity Failed !"); client_cmd(0, "spk holo/tr_holo_tryagain"); g_fwAllowMove = false; g_fwActive = false; } else { remove_task(TASKID); } }
stock ColorChat(index, const Msg[], {Float, Sql, Result,_}:...) { new Buffer[190], Buffer2[192]; formatex(Buffer2, sizeof(Buffer2)-1, "^3[^1%s^3]^1 %s", PREFIX, Msg); vformat(Buffer, sizeof(Buffer)-1, Buffer2, 3); if(!index) { for(new i = 1; i <= get_maxplayers(); i++) { if(!is_user_connected(i)) { continue; } message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, i); write_byte(i); write_string(Buffer); message_end(); } } else { if(!is_user_connected(index)) { return; } message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, index); write_byte(index); write_string(Buffer); message_end(); } } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2070\\ f0\\ fs16 \n\\ par } */
Bayadır bende duruyor yabancı bir siteden aldım hiç çevirmeden orjinal haliyle buraya koydum[/i][/i][/i][/i][/i]
Cevap: Guardian Menu - NeRo42 - 20-01-13
Link Hani
Cevap: Guardian Menu - kapucu1030 - 16-09-14
link
- - - - - - - - - -
link
|