Raised This Month: $ Target: $400
 0% 

Help Me (Gift Menu)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
echo_cs
Senior Member
Join Date: Dec 2011
Old 12-16-2011 , 09:03   Help Me (Gift Menu)
Reply With Quote #1

Plugin has not errors But He Does not work

Includes:
PHP Code:
#include <amxmodx>
#include <chatcolor>
#include <fun> 
Defines:
PHP Code:
#define PLUGIN "Gift Menu"
#define VERSION "1.0"
#define AUTHOR "echo_cs" 
Plugin Main:
PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("gift_menu""1")
    
register_clcmd("say /gift""Gift_Menu")

The Script:

PHP Code:
public Gift_Menu(id)
{
    if(!
get_cvar_num("gift_menu") )
        return 
PLUGIN_CONTINUE
    
    
new menu menu_create("\rSend Gift To:""menu_handler");
    
    new 
players[32], pnumtempid;
    
    new 
szName[32], szTempid[10];
    
    
get_players(playerspnum);
    
    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
        
get_user_name(tempidszNamecharsmax(szName));
        
num_to_str(tempidszTempidcharsmax(szTempid));
        
        
menu_additem(menuszNameszTempid0);
        
    }
    
    
menu_display(idmenu0);
    return 
PLUGIN_CONTINUE
}

public 
menu_handler(idmenuitem)
{
    new 
rand random_num(1,5)
    
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    
    new 
data[6], szName[64], Iname[32]
    
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);

    new 
tempid str_to_num(data);
    {
    
get_user_name(tempidszName31)
    
get_user_name(idIname31)
    
    switch(
rand
        {
        case 
1:set_user_health(tempid,get_user_health(tempid) + 50)
        case 
2:set_user_noclip(tempid,1)
        case 
3:set_user_footsteps(tempid0)
        case 
4:set_user_frags(tempidget_user_frags(tempid) + 10)
        case 
5:set_user_gravity(tempid0.5)
        }
        
    
client_print_color(0DontChange,"%s Send a Little Gift To %s"InameszName);
    }
menu_destroy(menu);
return 
PLUGIN_HANDLED

Help me and thanks
__________________
Pawn (5%)

C (80%)

C++ (20%)

SQL (5%)
echo_cs is offline
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 12-16-2011 , 10:02   Re: Help Me (Gift Menu)
Reply With Quote #2

You have an extra pair of {} in menu_handler() next to new tempid = str_to_num(data); and client_print_color(0, DontChange,"%s Send a Little Gift To %s", Iname, szName);

Also, you don't have to retrieve the name of tempid in menu_handler(), because you already have it in szName when you use menu_get_iteminfo().
__________________
"If God exists, I hope he has a good excuse." - Woody Allen
kotinha is offline
Reply



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


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