Raised This Month: $ Target: $400
 0% 

Admin Menu With God


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Shular
Junior Member
Join Date: Nov 2007
Old 11-20-2007 , 21:57   Admin Menu With God
Reply With Quote #1

I need to put godmode onto this menu but when i did it I tried to compile it with the godmode lines and it didnt work so i took em off and it worked how would i get it on?
Code:
#include <amxmodx>
#include <cstrike>
#include <fun>


#define PLUGIN "MenuMod"
#define VERSION "1.0"
#define AUTHOR "Shular"Note:Bent Wrote script tutorial im just adding godmode to it"

/*
CVARS
"menu_enable" 1 (menus on), 2 (menus off)


REQUIRES
ADMIN_LEVEL_A

SAY COMMANDS
/menu   (general menu)
/grav   (self-gravity)
/heal   (self-health)
/slap   (self-slap?? do you hate yourself??)
/money  (self-money)
/  **NEW/armor   (self-armor)
/  **NEW/speed   (self-speed)
/  **NEW/noclip  (self-noclip)
/  **NEW/Godmode (self-godmode)
MODULES
<amxmodx>
<amxmisc>
<cstrike>
<fun>
*/

new keys = MENU_KEY_0 | MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6 | MENU_KEY_7 | MENU_KEY_8 | MENU_KEY_9

new g_Switch;


public plugin_init() {
    register_plugin("Menu Commands", "1.0", "Shular")
    
    //Make the global variable "g_Switch" a cvar ("console command", "default setting(1)")
    g_Switch = register_cvar("menu_enable", "1")
    
    //Creates the menu id("name"), keys, "function")
    register_menucmd(register_menuid("ShularMenu"), 1023, "PressedSchularMenu")
    register_menucmd(register_menuid("GravMenu"), 1023, "PressedGravMenu")
    register_menucmd(register_menuid("HealMenu"), 1023, "PressedHealMenu")
    register_menucmd(register_menuid("SlapMenu"), 1023, "PressedSlapMenu")
    register_menucmd(register_menuid("MoneyMenu"), 1023, "PressedMoneyMenu")
    register_menucmd(register_menuid("ArmorMenu"), 1023, "PressedArmorMenu")
    register_menucmd(register_menuid("SpeedMenu"), 1023, "PressedSpeedMenu")
    register_menucmd(register_menuid("NoclipMenu"), 1023, "PressedNoclipMenu")
    register_menucmd(register_menuid("GodmodeMenu"),1023, "PressGodmodemenu")
    
    //Registers the console command("console command", "Function", admin flags, "info")
    register_clcmd("show_menu","ShowBentMenu",ADMIN_LEVEL_A,"-displays Bent's menu")
    register_clcmd("say /menu","ShowBentMenu",ADMIN_LEVEL_A,"-displays Bent's menu")
    register_clcmd("grav_menu","ShowGravMenu",ADMIN_LEVEL_A,"-displays Grav menu")
    register_clcmd("say /grav","ShowGravMenu",ADMIN_LEVEL_A,"-displays Grav menu")
    register_clcmd("heal_menu","ShowHealMenu",ADMIN_LEVEL_A,"-displays Heal menu")
    register_clcmd("say /heal","ShowHealMenu",ADMIN_LEVEL_A,"-displays Heal menu")
    register_clcmd("slap_menu","ShowSlapMenu",ADMIN_LEVEL_A,"-displays Slap menu")
    register_clcmd("say /slap","ShowSlapMenu",ADMIN_LEVEL_A,"-displays Slap menu")
    register_clcmd("money_menu","ShowMoneyMenu",ADMIN_LEVEL_A,"-displays Money menu")
    register_clcmd("say /money","ShowMoneyMenu",ADMIN_LEVEL_A,"-displays Money menu")
    register_clcmd("armor_menu","ShowArmorMenu",ADMIN_LEVEL_A,"-displays Armor menu")
    register_clcmd("say /armor","ShowArmorMenu",ADMIN_LEVEL_A,"-displays Armor menu")
    register_clcmd("speed_menu","ShowSpeedMenu",ADMIN_LEVEL_A,"-displays Speed menu")
    register_clcmd("say /speed","ShowSpeedMenu",ADMIN_LEVEL_A,"-displays Speed menu")
    register_clcmd("noclip_menu","ShowNoclipMenu",ADMIN_LEVEL_A,"-displays Noclip menu")
    register_clcmd("say /noclip","ShowNoclipMenu",ADMIN_LEVEL_A,"-displays Noclip menu")
    register_clcmd("Godmode_menu","ShowGodmodeMenu",ADMIN_LEVEL_A,"-display Godmode menu")
    register_clcmd("say /Godmode","ShowGodmodeMenu",ADMIN_LEVEL_A,"-display Godmode menu")
}


//Function (uses id parameter)
//id = the player that used the function
public ShowShularMenu(id) 
{
    //Checks the  g_switch cvar
    //if 0, it backs out of the function
    if(get_pcvar_num(g_Switch)==0)
    {
        return PLUGIN_HANDLED;
        }else{
            
        show_menu(id, keys, "\wKyle Menu^n1.Health + 250^n2.Money + 1000^n3.Armor + 100^n4.Speed 900^n5.Slap Self To 1 Health^n6.Slap Self 5 Damage^n7.Change Gravity To 400^n8.Reset^n9.Exit", -1, "ShularMenu") // Display menu
    }
    
    return PLUGIN_HANDLED;
}    

//Function
public PressedSchularMenu(id, key) 
{
    
    new Health = get_user_health(id);
    switch (key) 
    {
        
        //The commands
        //case 0 = 1 on the keyboard
        //case 1 = 2 on the keyboard, etc.
        //set_user health(user, health(remember the get user health that we assigned to the 
        //health constant?) Amount)
        case 0:    set_user_health(id, Health +250)
            case 1:    cs_set_user_money(id, cs_get_user_money(id) +1000)
            case 2:    set_user_armor(id, get_user_armor(id) +100)
            case 3:    set_user_maxspeed(id,900.0)
            case 4:    set_user_health(id,1)
            case 5:    set_user_health(id, Health  -5)
            case 6:    set_user_gravity(id,0.5)
            
        case 7:{
            set_user_armor(id,0)
            set_user_maxspeed(id,5.0)
            cs_set_user_money(id,800)
            set_user_health(id,100)
            return PLUGIN_HANDLED
        }
        case 8: return PLUGIN_HANDLED;
        }
    return PLUGIN_HANDLED
} 
public ShowGravMenu(id) 
{
    if(get_pcvar_num(g_Switch)==1)
    {
        show_menu(id, keys, "\rGravity Menu^n1 Gavity 800^n2 Gravity 600^n3 Gravity 400^n4 Gravity 200^n5 Gravity 0^n6 Exit^n", -1, "GravMenu") // Display menu
    }
    return PLUGIN_HANDLED;
}

//an easier way to set the cases is to assign a Float
//After each comma represent a new case
new const Float:gravity[5] = {1.0, 0.75, 0.5, 0.25, 0.00001}

public PressedGravMenu(id, key) 
{
    if(0 <= key <= 4)
        
    set_user_gravity(id, gravity[key])
    
    
    return PLUGIN_HANDLED
}
__________________
My Heros
Koolaid|-----50%-----|
PeterPan|-------70%---|
Spawn|----40%------|
Hollywood
Complete
CastorTroy
Complete
YosemiteSam
Complete


Shular is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode