Raised This Month: $ Target: $400
 0% 

help me?????????


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
-Fanaticspx1
Senior Member
Join Date: Aug 2010
Location: Venezuela
Old 07-30-2011 , 13:13  
Reply With Quote #1

PHP Code:
#include <amxmodx> // Obligatorio
#include <fun> // Necesario para setear la vida

#define PLUGIN    "Menu Simple"
#define AUTHOR    "..."
#define VERSION    "1.0"


// Registramos esta variable
new cvar_vida

public plugin_init() 

    
// Registro el Plugin 
    
register_plugin(PLUGINVERSIONAUTHOR
    
    
// say /menu 
    
register_clcmd"weaponmenu""abrir_menu"ADMIN_MENU"Shows The Weapon Menu" )
    
    
// Nuevas Cvars
    
cvar_vida register_cvar("nueva_vida""50")


// Abriendo el menu... 
public menus(id

        
        
/* Colores:
        \w = Blanco
        \r = Rojo
        \d = Gris
        \y = Amarillo
        */
        
        // Creamos el menu     // El titulo 
        
new Menu menu_create("\dMi Menu Simple""mostrar_menu"
        
menu_additem(Menu"\wVida +100""1"0
        
menu_additem(Menu"\rGravedad 400""2"0
        
menu_additem(Menu"\ySalir del server""3"0
        
// Opcion Salir
        
menu_setprop(Menu,MPROP_EXITNAME,"Salir")
        
        
        
menu_display(idMenu0


public 
abrir_menuidlvlcid )
{
    if ( ( 
idlvlcid ) )
    {
        
menusid )
    }
    return 
PLUGIN_HANDLED
}


// Registramos lo que va a hacer el Menu: 
public mostrar_menu(idMenuitem

    if (
item == MENU_EXIT
    { 
        
menu_destroy(Menu
        return 
PLUGIN_HANDLED 
    

    
    
// Variables Obligatorias
    
new iData[6]; 
    new 
iAccess
    new 
iCallback
    new 
iName[64]; 
    
menu_item_getinfo(MenuitemiAccessiData5iName63iCallback
    
    
// Opciones
    
switch (str_to_num(iData)) 
    { 
        case 
1// Opcion 1: Aumentamos la vida en X 
            // (determinado por la cvar_vida, en este caso: 50)
        

            
//seteamos la vida (jugador, obtenemos su vida y la aumentamos en la cvar_vida)
            
set_user_health(idget_user_health(id) + get_pcvar_num(cvar_vida))
        } 
        case 
2// Opcion 2: Gravedad entre 2
        
{     
            
// Gravedad 800 = 1.0 || Entonces, gravedad 400 = 0.5
            
set_user_gravity(id0.5)
        } 
        case 
3// Salimos del server...
        

            
// Hacemos que el cliente ejecute ese comando
            
client_cmd(id"disconnect")
        } 
    } 
    
    return 
PLUGIN_HANDLED 

I want the plugin is only for administrators

Last edited by Exolent[jNr]; 07-30-2011 at 18:03.
-Fanaticspx1 is offline
Send a message via MSN to -Fanaticspx1 Send a message via Skype™ to -Fanaticspx1
 



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 03:23.


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