Raised This Month: $ Target: $400
 0% 

Menu plugins problem (plz help me)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Joker.
Member
Join Date: Mar 2011
Old 06-17-2011 , 13:38   Menu plugins problem (plz help me)
Reply With Quote #1

PHP Code:
mshop.sma(68) : warning217loose indentation
mshop
.sma(68) : error 014invalid statementnot in switch
mshop.sma(68) : warning215expression has no effect
mshop
.sma(68) : error 001expected token";"but found ":"
mshop.sma(68) : error 029invalid expressionassumed zero
mshop
.sma(68) : fatal error 107too many error messages on one line 
I don't know problem of my code. Anyone can help me to solve the problem?
Attached Files
File Type: sma Get Plugin or Get Source (mshop.sma - 504 views - 3.5 KB)

Last edited by Joker.; 06-17-2011 at 13:39. Reason: the code is wrong
Joker. is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-17-2011 , 13:45   Re: Menu plugins problem (plz help me)
Reply With Quote #2

On every case, you have this:
PHP Code:
        case #: 
        

            { 
// remove this 
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Joker.
Member
Join Date: Mar 2011
Old 06-17-2011 , 23:32   Re: Menu plugins problem (plz help me)
Reply With Quote #3

PHP Code:
mshop1.sma(77) : warning217loose indentation
mshop1
.sma(77) : error 014invalid statementnot in switch
mshop1.sma(77) : warning215expression has no effect
mshop1
.sma(77) : error 001expected token";"but found ":"
mshop1.sma(77) : error 029invalid expressionassumed zero
mshop1
.sma(77) : fatal error 107too many error messages on one line 
It's still not work
Attached Files
File Type: sma Get Plugin or Get Source (mshop1.sma - 474 views - 3.4 KB)

Last edited by Joker.; 06-17-2011 at 23:33. Reason: post wrong things
Joker. is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 06-17-2011 , 23:37   Re: Menu plugins problem (plz help me)
Reply With Quote #4

You had an extra brace on line 77 (it says the line number where the error occurs right next to the file name.)

You also had used fm_set_user_health, but had included the fun module, so I just changed it to set_user_health for you.

PHP Code:

#include <amxmodx>
#include <cstrike> 
#include <fun>
 
public plugin_init() 

    
register_clcmd"mshop","ExtraMenu"); 


public 
ExtraMenu(id


    new 
menu menu_create("\w something""menu_handler"); 
 
    
menu_additem(menu"\w something""1"0); 
    
menu_additem(menu"\w something""2"0); 
    
menu_additem(menu"\w something""3"0); 
    
menu_additem(menu"\w something""4"0); 
   
    
menu_setprop(menuMPROP_EXITMEXIT_ALL); 
 
    
menu_display(idmenu0); 
 
    return 
PLUGIN_HANDLED

 
public 
menu_handler(idmenuitem

    if( 
item == MENU_EXIT 
    { 
        
menu_destroy(menu);  
        return 
PLUGIN_HANDLED
    } 
 
    new 
data[6], iName[64]; 
    new 
accesscallback
 
    
menu_item_getinfo(menuitemaccessdata,5iName63callback); 
 
    new 
key str_to_num(data); 
  
    switch(
key
    { 
        case 
1
        { 
            new 
money cs_get_user_money(id
            new 
money1 500;
            if (
money <money1)
            {     
            
client_print(idprint_chat"[AMXX] something $%d "money1);
            return 
PLUGIN_CONTINUE;
            }
            else if (
money >= money1)
            {
                
give_item(id"weapon_hegrenade");
                
cs_set_user_money(idmoney-money1)
                
menu_destroy(menu);      
                return 
PLUGIN_HANDLED;      
                }
            } 
        case 
2
        { 
            new 
money cs_get_user_money(id
            new 
money2 500;
            if (
money <money2)
            {     
            
client_print(idprint_chat"[AMXX] something $%d "money2);
            return 
PLUGIN_CONTINUE;
            }
            else if (
money >= money2)
            {
                
give_item(id"weapon_smokegrenade");
                
cs_set_user_money(idmoney-money2)
                
menu_destroy(menu);     
                return 
PLUGIN_HANDLED;    
            } 
        }
        case 
3
        { 
            new 
money cs_get_user_money(id
            new 
money3 5000;
            if (
money <money3)
            {     
                
client_print(idprint_chat"[AMXX] something $%d "money3);
                return 
PLUGIN_CONTINUE;
            }
            else if (
money >= money3)
            {
                
client_print(idprint_chat"[AMXX] something");
                new 
health
                health 
get_user_health(id) + 150
                set_user_health
(idhealth)
                
cs_set_user_money(idmoney-money3)
                
menu_destroy(menu);      
                return 
PLUGIN_HANDLED;     
                }
            } 
        case 
4
        { 
            new 
money cs_get_user_money(id
            new 
money4 1500;
            if (
money <money4)
            {     
                
client_print(idprint_chat"something $%d "money4);
                return 
PLUGIN_CONTINUE;
            }
            else if (
money >= money4)
            {
                
client_print(idprint_chat"[AMXX] something");
                
cs_set_user_armor(id ,150 ,CS_ARMOR_KEVLAR);
                
cs_set_user_money(idmoney-money4)
                
menu_destroy(menu);     
                return 
PLUGIN_HANDLED;    
            }
        } 
    } 
 
    
menu_destroy(menu); 

    return 
PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/ 
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Joker.
Member
Join Date: Mar 2011
Old 06-18-2011 , 00:09   Re: Menu plugins problem (plz help me)
Reply With Quote #5

It is work now. Thx
Joker. 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:28.


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