Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #include <fun>
- #include <hamsandwich>
- #include <fakemeta>
- #include <engine>
- #define PLUGIN "CS-Menu"
- #define VERSION "1.0"
- #define AUTHOR "Mostwanted"
- #define TAG "[CS]Admin"
- #define TAG2 "[CS]Member"
- #define Website "Coming Soon"
- #define menusize 300
- //#define SoundName "Vote"
- // Reden (Voor kick, slay,..)
- new TotalReasons = 12
- new const REDEN[][64] = {
- "Abuse",
- "Racism",
- "Advertisement",
- "Bug Using",
- "Harrasment",
- "Blocking",
- "Screaming in mic",
- "FunJump",
- "Understab",
- "Undercamp",
- "Scripts",
- "Rule Breaker"
- }
- // Namen, voor Bb
- new const BsNames[][64] = {
- "[C-S-Admin]", // ADMIN_LEVEL_A -> m
- "[C-S-Mini Admin]" // ADMIN_LEVEL_C -> o
- }
- new cStatus, cBanTime, cNoclipTime, cDamage, cQuadDmgTime, cMuteTime;
- new g_msgFade;
- new Name[33], Reason[33], Style[33], Num[33], QuadDamage[33], tTransfer[33];
- new cVoting,cVotetype,cVoteYes,cVoteNo, bool:is_muted[33]
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- /* Cvar's */
- cStatus = register_cvar("Collusion_status" , "1");
- cDamage = register_cvar("Collusion_damage" , "2.0");
- // Times
- cBanTime = register_cvar("Collusion_bantime" , "60.0");
- cNoclipTime = register_cvar("Collusion_nocliptime", "10.0");
- cQuadDmgTime = register_cvar("Collusion_quaddmgtime", "15.0");
- cMuteTime = register_cvar("Collusion_mutetime" , "600.0");
- /* Say Commands */
- register_clcmd("say csmenu", "cmdShowMenu", -1, "- Displays cg menu")
- register_clcmd("say csmenu", "cmdShowMenu", -1, "- Displays cg menu")
- register_clcmd("say_team cspmenu", "cmdShowMenu", -1, "- Displays cg menu")
- /* Ham */
- RegisterHam(Ham_Spawn, "player" , "PlayerSpawn", 1);
- RegisterHam(Ham_TakeDamage, "player" , "PlayerDamage");
- /* Other Stuff */
- g_msgFade = get_user_msgid("ScreenFade");
- /* Menu Register */
- register_menucmd(register_menuid("\dmTc:"), (1<<0|1<<1),"VoteMenu");
- }
- public client_connect(id)
- tTransfer[id]=0
- /*
- mTc:
- - Menu's
- */
- public cmdShowMenu(id) {
- if(get_pcvar_num(cStatus) && is_user_connected(id)) {
- ScreenFadeIn(id)
- MainMenu(id)
- }
- return PLUGIN_HANDLED;
- }
- public MainMenu(id) {
- new Temp[101]
- formatex(Temp,100, "\d%s\y: Main Menu^n\wVisit\r %s", TAG, Website)
- new menu = menu_create(Temp, "menuHandler");
- if(access(id, ADMIN_LEVEL_A)) menu_additem(menu, "\rAdmin\w Menu", "1", 0);
- else menu_additem(menu, "\dAdmin\w Menu", "1", 0);
- if(access(id, ADMIN_LEVEL_C)) menu_additem(menu, "\rMember\w Menu", "2", 0);
- else menu_additem(menu, "\dMember\w Menu", "2", 0);
- menu_display(id, menu, 0)
- }
- public AdminMenu(id) {
- new Temp[64]
- formatex(Temp,63, "\d%s\y: Admin Menu", TAG)
- new Adminmenu = menu_create(Temp, "AdminmenuHandler");
- menu_additem(Adminmenu, "\rSlap\w Player", "1", 0);
- menu_additem(Adminmenu, "\rSlay\w Player", "2", 0);
- menu_additem(Adminmenu, "\rKick\w Player", "3", 0);
- menu_additem(Adminmenu, "\rBan\w Player", "4", 0);
- menu_additem(Adminmenu, "\rRevive\w Players", "5", 0);
- menu_additem(Adminmenu, "\rGive Noclip" ,"6", 0);
- menu_display(id, Adminmenu, 0)
- }
- public MiniAdminMenu(id) {
- new Temp[101]
- formatex(Temp,100, "\d%s\y: Members Menu^n\wVisit\r %s", TAG, Website)
- new Membermenu = menu_create(Temp, "MembermenuHandler");
- menu_additem(Membermenu, "\rSlap\w Player", "1", 0);
- menu_additem(Membermenu, "\rSlay\w Player", "2", 0);
- menu_additem(Membermenu, "\rBan 60min\w Player", "3", 0);
- menu_additem(Membermenu, "\rPlayer\w Transfer", "4", 0);
- menu_display(id, Membermenu, 0)
- }
- public menuHandler(id, menu, key) {
- if( key == MENU_EXIT ) {
- ScreenFadeOut(id)
- menu_destroy(menu)
- return PLUGIN_HANDLED
- }
- switch(key) {
- case 0: {
- if(access(id, ADMIN_LEVEL_A)) AdminMenu(id)
- else cmdShowMenu(id)
- }
- case 1: {
- if(access(id, ADMIN_LEVEL_C)) MiniAdminMenu(id)
- else cmdShowMenu(id)
- }
- }
- menu_destroy(menu)
- return PLUGIN_HANDLED
- }
- public AdminmenuHandler(id, menu, key) {
- if( key == MENU_EXIT ) {
- MainMenu(id)
- menu_destroy(menu);
- return PLUGIN_HANDLED
- }
- switch(key) {
- case 0: {
- Style[id] = 0 // Slap
- Num[id] = 0
- PlayerList(id)
- }
- case 1: {
- Style[id] = 1 // Slay
- Num[id] = 0
- PlayerList(id)
- }
- case 2: {
- Style[id] = 2 // Kick
- Num[id] = 0
- PlayerList(id)
- }
- case 3: {
- Style[id] = 3 // Ban
- Num[id] = 0
- PlayerList(id)
- }
- case 4: {
- Style[id] = 8 // Revive
- Num[id] = 0
- PlayerList2(id)
- }
- case 5: SwapPlayers(id, 0)
- //case 6: MapChange(id, 0)
- case 7: {
- Style[id] = 6 // Give Noclip
- Num[id] = 0
- PlayerList2(id)
- }
- case 8: {
- Style[id] = 7 // Give Glow
- Num[id] = 0
- PlayerList2(id)
- }
- case 9: {
- Style[id] = 9 // Give Drug
- Num[id] = 0
- PlayerList2(id)
- }
- }
- return PLUGIN_HANDLED;
- }
- public VipmenuHandler(id, menu, key) {
- if( key == MENU_EXIT ) {
- MainMenu(id)
- menu_destroy(menu);
- return PLUGIN_HANDLED
- }
- switch(key) {
- case 0:{
- if(access(id, ADMIN_LEVEL_B)) {
- Style[id] = 0
- Num[id] = 1
- PlayerList(id) // Slap
- }
- else MainMenu(id)
- }
- case 1: {
- if(access(id, ADMIN_LEVEL_B)) {
- Style[id] = 1
- Num[id] = 1
- PlayerList(id) // Slay
- }
- else MainMenu(id)
- }
- case 2: {
- if(access(id, ADMIN_LEVEL_B)) {
- Num[id] = 1
- showtransfermenu(id)
- }
- else MainMenu(id)
- }
- case 3: {
- if(access(id, ADMIN_LEVEL_B))
- NoclipPlayer(id, 1)
- else MainMenu(id)
- }
- case 4: {
- if(access(id, ADMIN_LEVEL_B))
- QuaddmgPlayer(id, 1)
- else MainMenu(id)
- }
- case 5: {
- if(access(id, ADMIN_LEVEL_B)) {
- if(is_user_alive(id))
- WeaponpacketPlayer(id, 1)
- }
- else MainMenu(id)
- }
- case 6: {
- Style[id] = 4
- Num[id] = 1
- cVoting = 1
- cVotetype = 1
- PlayerList(id) //Vote Kick
- }
- case 7: {
- Style[id] = 4
- Num[id] = 1
- cVoting = 1
- cVotetype = 2
- PlayerList(id) //Vote Ban
- }
- case 8: {
- Style[id] = 4
- Num[id] = 1
- cVoting = 1
- cVotetype = 3
- PlayerList(id) //Vote Mute
- }
- //case 8: VoteMap(id)
- }
- menu_destroy(menu)
- return PLUGIN_HANDLED;
- }
- public MembermenuHandler(id, menu, key) {
- if( key == MENU_EXIT ) {
- ScreenFadeOut(id)
- MainMenu(id)
- menu_destroy(menu);
- return PLUGIN_HANDLED
- }
- switch(key) {
- case 0: {
- Style[id] = 0 // Slap
- Num[id] = 2
- PlayerList(id)
- }
- case 1: {
- Style[id] = 1 // Slay
- Num[id] = 2
- PlayerList(id)
- }
- case 2: {
- Style[id] = 2 // Kick
- Num[id] = 2
- PlayerList(id)
- }
- case 3: {
- Style[id] = 3 // Ban
- Num[id] = 2
- PlayerList(id)
- }
- case 4: {
- Num[id] = 2
- showtransfermenu(id)
- }
- //case 5: VoteMapChange(id, 0)
- }
- return PLUGIN_HANDLED;
- }
- // Team Transfer
- public showtransfermenu(id) {
- new menu = menu_create("\dmTc:\y Transfer Menu", "TransferMenu");
- new players[32], name[32], pnum, player;
- new szplayer[6]
- get_players(players,pnum)
- switch(tTransfer[id]) {
- case 0:menu_additem(menu, "\r Counter Terrorist^n", "0", 0);
- case 1:menu_additem(menu, "\r Terrorist^n", "0", 0);
- case 2:menu_additem(menu, "\r Spectator^n", "0", 0);
- }
- for( new i; i<pnum; i++ ) {
- player = players[i]
- if((tTransfer[id] == 0 && cs_get_user_team(player) == CS_TEAM_CT)
- || (tTransfer[id] == 1 && cs_get_user_team(player) == CS_TEAM_T)
- || (tTransfer[id] == 2 && cs_get_user_team(player) == CS_TEAM_SPECTATOR))
- continue;
- else {
- get_user_name(players[i],name,31)
- num_to_str(player,szplayer,5)
- menu_additem(menu, name, szplayer, 0);
- }
- }
- menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
- menu_display(id, menu, 0);
- }
- /*
- CG:
- - Slap Player
- - Slay Player
- - Kick Player
- - Ban Player
- - Swap Teams
- - Quad Damage
- - WeaponPacket
- - NoClip
- - Glow Player
- - TransferPlayer
- - Map Change
- */
- public SlapPlayer(id, num) {
- new name[32], name2[32]
- get_user_name(id, name, 31)
- get_user_name(Name[id], name2, 31)
- if(is_user_alive(Name[id])) {
- user_slap(Name[id], 0)
- user_slap(Name[id], 0)
- if(id == Name[id]) {
- ChatColor(0, "!g%s!team %s !ygives himself a hard slap. !g%s", TAG2,name, BsNames[num])
- ScreenFadeOut(id)
- return PLUGIN_HANDLED
- }
- else
- ChatColor(0, "!g%s !team%s!y slapped !team%s!y for !team'%s'!g %s", TAG2, name, name2, REDEN[Reason[id]], BsNames[num])
- }
- else ChatColor(id, "!g%s!team %s !yis dead?", TAG2, name2)
- ScreenFadeOut(id)
- return PLUGIN_HANDLED;
- }
- public SlayPlayer(id, num) {
- new name[32], name2[32]
- get_user_name(id, name, 31)
- get_user_name(Name[id], name2, 31)
- if(is_user_alive(Name[id])) {
- if(id == Name[id]) {
- user_silentkill(id)
- make_deathmsg(id, Name[id], 1, "deagle")
- ChatColor(0, "!g%s !team%s!y takes a revolver, points at hes head and fires. !g%s", TAG2, name, BsNames[num])
- ScreenFadeOut(id)
- return PLUGIN_HANDLED;
- }
- else {
- user_silentkill(Name[id])
- make_deathmsg(id, Name[id], 0, "worldspawn")
- ChatColor(0, "!g%s !team%s!y slayed !team%s!y for !team'%s'!g %s", TAG2, name, name2, REDEN[Reason[id]], BsNames[num])
- }
- }
- else ChatColor(id, "!g%s!team %s !yis dead?", TAG2, name2)
- ScreenFadeOut(id)
- return PLUGIN_HANDLED;
- }
- public KickPlayer(id, num) {
- new name[32], name2[32]
- get_user_name(id, name, 31)
- get_user_name(Name[id], name2, 31)
- if(id == Name[id]) {
- server_cmd("kick ^"%s^"",name)
- ChatColor(0, "!g%s !team%s !ygot tired of the game and kicked himself. !g%s", TAG2, name, BsNames[num])
- ScreenFadeOut(id)
- return PLUGIN_HANDLED;
- }
- else {
- server_cmd("kick ^"%s^"",name2)
- ChatColor(0, "!g%s !team%s!y kicked !team%s!y for !team'%s'!g %s", TAG2, name, name2, REDEN[Reason[id]], BsNames[num])
- }
- ScreenFadeOut(id)
- return PLUGIN_HANDLED;
- }
- public BanPlayer(id, num) {
- new name[32], name2[32]
- get_user_name(id, name, 31)
- get_user_name(Name[id], name2, 31)
- server_cmd("banid %i #%i Banned;writeid",get_pcvar_num(cBanTime),get_user_userid(Name[id]))
- server_cmd("kick #%s ^"%s banned u for %s^"", Name[id], name, REDEN[Reason[id]])
- ChatColor(0, "!g%s !team%s!y banned !team%s!y for !team'%s'!g %s", TAG2, name, name2, REDEN[Reason[id]], BsNames[num])
- ScreenFadeOut(id)
- }
- public SwapPlayers(id, num) {
- new players[32], num, player
- get_players(players, num)
- for(new i = 0; i < num; i++) {
- player = players[i]
- cs_set_user_team(player, cs_get_user_team(player) == CS_TEAM_T ? CS_TEAM_CT:CS_TEAM_T)
- }
- new name[32]
- get_user_name(id, name, 31)
- ChatColor(0, "!g%s !team%s!y swapped the teams!", TAG2, name, BsNames[num])
- server_cmd("sv_restartround 3")
- server_exec()
- ScreenFadeOut(id)
- return PLUGIN_HANDLED
- }
- public QuaddmgPlayer(id, num) {
- QuadDamage[id] = 1
- new name[32]
- get_user_name(id, name, 31)
- ChatColor(0,"!g%s !team%s!y has now '!teamQuad Damage!y' for !g%i!ysec !g%s", TAG2, name, get_pcvar_num(cQuadDmgTime), BsNames[num])
- set_user_rendering(id, kRenderFxGlowShell, 180, 255, 175, kRenderNormal, 20);
- ScreenFadeOut(id)
- set_task(get_pcvar_float(cQuadDmgTime), "ResetQuadDmg", id)
- }
- public ResetQuadDmg(id) {
- new name[32]
- get_user_name(id, name, 31)
- QuadDamage[id] = 0
- ChatColor(0,"!g%s !team%s!y's QuadDamage is removed.", TAG2, name)
- set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 0);
- }
- public WeaponpacketPlayer(id, num) {
- new name[32]
- get_user_name(id, name, 31)
- ChatColor(0,"!g%s !team%s!y has taked the '!teamWeapon Packet!y'!g %s", TAG2, name, BsNames[num])
- strip_user_weapons(id)
- give_item(id, "weapon_knife");
- give_item(id, "weapon_deagle")
- cs_set_user_bpammo(id,CSW_DEAGLE,35);
- give_item(id, "weapon_m4a1");
- cs_set_user_bpammo(id,CSW_M4A1,90)
- give_item(id, "weapon_hegrenade");
- ScreenFadeOut(id)
- }
- public GiveDrug(id, num) {
- if(!is_user_alive(Name[id]))
- return PLUGIN_HANDLED;
- message_begin(MSG_ONE, get_user_msgid("SetFOV"), {0,0,0}, id)
- write_byte(170)
- message_end()
- new name[32]; get_user_name(id, name, 31)
- new name2[32]; get_user_name(Name[id], name2, 31)
- if(id == Name[id]) {
- ChatColor(0, "!g%s !team%s !ygives himself !team'Drugs'!y. !g%s", TAG2, name, BsNames[num])
- ScreenFadeOut(id)
- set_task(10.0, "DrugStop", Name[id]);
- return PLUGIN_HANDLED;
- }
- else
- ChatColor(0,"!g%s !team%s!y gives !team'Drugs'!y to !team%s!y for !g10!ysec!g %s", TAG2, name, name2, BsNames[num])
- ScreenFadeOut(id)
- set_task(10.0, "DrugStop", Name[id]);
- return PLUGIN_HANDLED;
- }
- public DrugStop(id) {
- if(is_user_alive(id)) {
- message_begin(MSG_ONE, get_user_msgid("SetFOV"), {0,0,0}, id)
- write_byte(90)
- message_end()
- }
- }
- public GiveGlow(id, num) {
- if(!is_user_alive(Name[id]))
- return PLUGIN_HANDLED;
- set_user_rendering(Name[id], kRenderFxGlowShell, random_num(0,255), random_num(0,255), random_num(0,255), kRenderNormal, 0);
- new name[32]; get_user_name(id, name, 31)
- new name2[32]; get_user_name(Name[id], name2, 31)
- if(id == Name[id]) {
- ChatColor(0, "!g%s!team %s !ygives himself a !team'Random Glow'!y. !g%s", TAG2, name, BsNames[num])
- ScreenFadeOut(id)
- return PLUGIN_HANDLED;
- }
- else
- ChatColor(0,"!g%s !team%s!y gives !team'Random Glow'!y to !team%s!y for !g%i!ysec!g %s", TAG2, name, name2, BsNames[num])
- ScreenFadeOut(id)
- return PLUGIN_HANDLED;
- }
- public GiveNoclip(id, num) {
- if(!is_user_alive(Name[id]))
- return PLUGIN_HANDLED;
- set_user_noclip(Name[id], 1)
- new name[32]; get_user_name(id, name, 31)
- new name2[32]; get_user_name(Name[id], name2, 31)
- ChatColor(0,"!g%s !team%s!y gives !team'Noclip'!y to !team%s!y for !g%i!ysec!g %s", TAG2, name, name2, get_pcvar_num(cNoclipTime), BsNames[num])
- ScreenFadeOut(id)
- set_task(get_pcvar_float(cNoclipTime), "ResetNoclip", Name[id])
- return PLUGIN_HANDLED;
- }
- public NoclipPlayer(id, num) {
- if(!is_user_alive(id))
- return PLUGIN_HANDLED;
- set_user_noclip(id, 1)
- new name[32]
- get_user_name(id, name, 31)
- ChatColor(0,"!g%s !team%s!y has now '!teamNoclip!y' for !g%i!ysec!g %s", TAG2, name, get_pcvar_num(cNoclipTime), BsNames[num])
- ScreenFadeOut(id)
- set_task(get_pcvar_float(cNoclipTime), "ResetNoclip", id)
- return PLUGIN_HANDLED;
- }
- public ResetNoclip(id) {
- if(is_user_alive(id)) {
- new name[32]
- get_user_name(id, name, 31)
- set_user_noclip(id, 0)
- ChatColor(0,"!g%s !team%s!y's NoClip is removed.", TAG2, name)
- }
- }
- public RevivePlayer(id, num) {
- ExecuteHamB( Ham_CS_RoundRespawn, Name[id] );
- new name[32]; get_user_name(id, name, 31)
- new name2[32]; get_user_name(Name[id], name2, 31)
- if(id == Name[id])
- ChatColor(0, "!g%s!team %s!y revived himself. !g%s", TAG2, name, BsNames[num])
- ChatColor(0,"!g%s !team%s!y revived !team%s!g %s", TAG2, name, name2, BsNames[num])
- ScreenFadeOut(id)
- }
- public TransferMenu(id, menu, item) {
- if( item == MENU_EXIT ) {
- menu_destroy(menu);
- MainMenu(id)
- return PLUGIN_HANDLED;
- }
- new data[6], iName[64];
- new access, callback;
- menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
- new player = str_to_num(data)
- if(!player) {
- switch(tTransfer[id]) {
- case 2: tTransfer[id]=0
- default: tTransfer[id]++
- }
- showtransfermenu(id)
- return PLUGIN_CONTINUE;
- }
- new name[2][32]
- get_user_name(player,name[1],31)
- get_user_name(id,name[0],31)
- switch(tTransfer[id]) {
- case 0: {
- cs_set_user_team(player, CS_TEAM_CT)
- user_silentkill(player)
- ChatColor(0, "!g%s !team%s !ytransfered !team%s!y to the 'Counter-Terrorists'. !g%s", TAG2, name[0] ,name[1], BsNames[Num[id]])
- }
- case 1: {
- cs_set_user_team(player, CS_TEAM_T)
- user_silentkill(player)
- ChatColor(0, "!g%s !team%s !ytransfered !team%s!y to the 'Terrorists'. !g%s", TAG2, name[0] ,name[1], BsNames[Num[id]])
- }
- case 2: {
- cs_set_user_team(player, CS_TEAM_SPECTATOR)
- user_silentkill(player)
- ChatColor(0, "!g%s !team%s !ytransfered !team%s!y to the 'Spectators'. !g%s", TAG2, name[0] ,name[1], BsNames[Num[id]])
- }
- }
- /*
- new ctime[64]
- get_time("%m/%d/%Y - %H:%M:%S", ctime, 63)
- new temp[100]
- formatex(temp,99, "%s : Transfer %s",ctime,name[1])
- VipLog(id, temp)
- */
- showtransfermenu(id)
- return PLUGIN_CONTINUE;
- }
- /*
- mTc:
- - Player List
- - Reasons
- */
- public PlayerList(id) {
- new Playermenu, Temp[64]
- formatex(Temp,63, "\d%s\y: Choose a player:", TAG)
- Playermenu = menu_create(Temp, "PlayerHandler");
- new players[32], pnum, tempid;
- new szName[32], szTempid[10];
- get_players(players, pnum, "ch");
- for( new i; i<pnum; i++ ) {
- //if (get_user_flags(players[i]) & ADMIN_IMMUNITY)
- // continue;
- tempid = players[i];
- get_user_name(tempid, szName, 31);
- num_to_str(tempid, szTempid, 9);
- menu_additem(Playermenu, szName, szTempid, 0);
- }
- menu_display(id, Playermenu);
- return PLUGIN_HANDLED;
- }
- public ReasonList(id) {
- new Reasonmenu, Temp[64]
- formatex(Temp,63, "\d%s\y: Choose a reason:", TAG)
- Reasonmenu = menu_create(Temp, "ReasonHandler");
- new key[6]
- for(new i; i < TotalReasons; i++) {
- num_to_str(i,key,sizeof(key)-1)
- menu_additem(Reasonmenu, REDEN[i], key, 0);
- }
- menu_display(id, Reasonmenu);
- return PLUGIN_HANDLED;
- }
- public ReasonHandler(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);
- Reason[id] = str_to_num(data);
- switch(Style[id]) {
- case 0: SlapPlayer(id, Num[id]) // Slap
- case 1: SlayPlayer(id, Num[id]) // Slay
- case 2: KickPlayer(id, Num[id]) // Kick
- case 3: BanPlayer(id, Num[id]) // Ban
- case 4: showvotemenu(id) // Vote stuff
- }
- menu_destroy(menu);
- return PLUGIN_HANDLED;
- }
- public PlayerHandler(id, menu, item) {
- if( item == MENU_EXIT ) {
- menu_destroy(menu);
- ScreenFadeOut(id)
- return PLUGIN_HANDLED;
- }
- new data[6], iName[64];
- new access, callback;
- menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
- Name[id] = str_to_num(data);
- ReasonList(id)
- menu_destroy(menu);
- return PLUGIN_HANDLED;
- }
- public PlayerList2(id) {
- new Playermenu, Temp[64]
- formatex(Temp,63, "\d%s\y: Choose a player:", TAG)
- Playermenu = menu_create(Temp, "PlayerHandler2");
- new players[32], pnum, tempid;
- new szName[32], szTempid[10];
- get_players(players, pnum, "ch");
- for( new i; i<pnum; i++ ) {
- //if (get_user_flags(players[i]) & ADMIN_IMMUNITY)
- // continue;
- tempid = players[i];
- get_user_name(tempid, szName, 31);
- num_to_str(tempid, szTempid, 9);
- menu_additem(Playermenu, szName, szTempid, 0);
- }
- menu_display(id, Playermenu);
- return PLUGIN_HANDLED;
- }
- public PlayerHandler2(id, menu, item) {
- if( item == MENU_EXIT ) {
- menu_destroy(menu);
- ScreenFadeOut(id)
- return PLUGIN_HANDLED;
- }
- new data[6], iName[64];
- new access, callback;
- menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
- Name[id] = str_to_num(data);
- switch(Style[id]) {
- case 6: GiveNoclip(id, Num[id])
- case 7: GiveGlow(id, Num[id])
- case 8: RevivePlayer(id, Num[id])
- case 9: GiveDrug(id, Num[id])
- }
- menu_destroy(menu);
- return PLUGIN_HANDLED;
- }
- /*
- mTc:
- - Screen Fade: In & Out
- */
- ScreenFadeIn(id) {
- message_begin(MSG_ONE, g_msgFade, {0,0,0}, id); // use the magic #1 for "one client"
- write_short( ~0 ); // fade lasts this long duration
- write_short( ~0 ); // fade lasts this long hold time
- write_short( 1<<12 ); // fade type
- write_byte( 0 ); // fade red
- write_byte( 0 ); // fade green
- write_byte( 0 ); // fade blue
- write_byte( 175 ); // fade alpha
- message_end( );
- return PLUGIN_CONTINUE;
- }
- ScreenFadeOut(id) {
- message_begin(MSG_ONE, g_msgFade, {0,0,0}, id); // use the magic #1 for "one client"
- write_short( 1<<12 ); // fade lasts this long duration
- write_short( 1<<8 ); // fade lasts this long hold time
- write_short( 1<<1 ); // fade type
- write_byte( 0 ); // fade red
- write_byte( 0 ); // fade green
- write_byte( 0 ); // fade blue
- write_byte( 128 ); // fade alpha
- message_end( );
- return PLUGIN_CONTINUE;
- }
- /*
- mTc:
- - Player Spawn
- - Player Damage
- */
- public PlayerSpawn(id) {
- if(get_pcvar_num(cStatus) && is_user_connected(id)) {
- QuadDamage[id] = 0
- if(access(id, ADMIN_LEVEL_A))
- cs_set_user_vip(id, 0, 0, 1)
- }
- }
- public PlayerDamage(id, iInflictor, iAttacker, Float:flDamage, iDamageBits) {
- if(QuadDamage[iAttacker] && is_user_connected(id) && is_user_alive(iAttacker))
- SetHamParamFloat(4,floatmul(flDamage,get_pcvar_float(cDamage)))
- }
- /*
- mTc:
- - Save Stuff
- VipLog(id, data[]) {
- new authid[32],name[32]
- get_user_authid(id,authid,31)
- get_user_name(id,name,31)
- new iFile = fopen(Logpath, "a");
- if( !iFile )
- return;
- fprintf(iFile, "^"%s^" ^"%s^" ^"%s^" ^n",authid,name,data)
- fclose(iFile);
- }
- mTc:
- - Color Chat
- */
- stock ChatColor(const id, const input[], any:...) {
- new count = 1, players[32]
- static msg[191]
- vformat(msg, 190, input, 3)
- replace_all(msg, 190, "!g", "^4") // Green Color
- replace_all(msg, 190, "!y", "^1") // Default Color
- replace_all(msg, 190, "!team", "^3") // Team Color
- if (id)
- players[0] = id
- else {
- get_players(players, count, "ch")
- for (new i = 0; i < count; i++) {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
- public showvotemenu(id)
- {
- new name[32], name2[32]
- get_user_name(Name[id],name,31)
- get_user_name(id,name2,31)
- new keys = (1<<0|1<<1);
- new szMenuBody[menusize - 1];
- new line[84]
- switch(cVotetype) {
- case 1:formatex(line,99,"\r %s \ywanne kick\r %s \yfor\r %s^n\w Do you accept?", name2, name, REDEN[Reason[id]])
- case 2:formatex(line,99,"\r %s \ywanne ban\r %s \yfor\r %s^n\w Do you accept?", name2, name, REDEN[Reason[id]])
- case 3:formatex(line,99,"\r %s \ywanne mute\r %s \yfor\r %s^n\w Do you accept?", name2, name, REDEN[Reason[id]])
- }
- new nLen = format(szMenuBody, menusize, "\dmTc:%s^n",line);
- nLen += format(szMenuBody[nLen], menusize-nLen, "^n\w1. Yes");
- nLen += format(szMenuBody[nLen], menusize-nLen, "^n\w2. No");
- cVoteYes=0
- cVoteNo=0
- new players[32], pnum;
- get_players(players, pnum);
- for( new i; i<pnum; i++ ) {
- show_menu(players[i], keys, szMenuBody, 10);
- }
- set_task(10.0, "EndVote", id);
- }
- public VoteMenu(id, key) {
- switch(key) {
- case 0: {
- if(cVoting) {
- cVoteYes++
- ChatColor(id, "!g%s!y You voted!team Yes!y.", TAG2)
- }
- }
- case 1: {
- if(cVoting) {
- cVoteNo++
- ChatColor(id, "!g%s!y You voted!team No!y.", TAG2)
- }
- }
- }
- return PLUGIN_HANDLED
- }
- public EndVote(id)
- {
- new name[32]
- get_user_name(Name[id],name,31)
- if(cVoteYes > cVoteNo) {
- switch(cVotetype) {
- case 1: {
- ChatColor(id, "!g%s!y Vote to kick!team %s!y succesfull.", TAG2, name)
- server_cmd("kick ^"%s^"",name)
- }
- case 2: {
- ChatColor(id, "!g%s!y Vote to ban!team %s!y succesfull.", TAG2, name)
- server_cmd("banid %i #%i Banned;writeid",get_pcvar_num(cBanTime),get_user_userid(Name[id]))
- server_cmd("kick ^"%s^"",name)
- }
- case 3: {
- ChatColor(id, "!g%s!y Vote to mute!team %s!y succesfull.", TAG2, name)
- is_muted[id]=true
- set_speak( id, SPEAK_MUTED );
- set_task(get_pcvar_float(cMuteTime), "UnMute", id)
- }
- }
- }
- else {
- switch(cVotetype) {
- case 1: {
- ChatColor(id, "!g%s!y Vote to kick!team %s!y failed.", TAG2, name)
- }
- case 2: {
- ChatColor(id, "!g%s!y Vote to ban!team %s!y failed.", TAG2, name)
- }
- case 3: {
- ChatColor(id, "!g%s!y Vote to mute!team %s!y failed.", TAG2, name)
- }
- }
- }
- cVoting = 0
- }
- public UnMute(id) {
- if(is_muted[id]) {
- is_muted[id]=false
- set_speak(id, SPEAK_NORMAL);
- ChatColor(id, "!g%s!y You are now unmuted.", TAG2)
- }
- }
Add Comment
Please, Sign In to add comment