Raised This Month: $ Target: $400
 0% 

Compile HELP!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tobbiass
Junior Member
Join Date: Dec 2011
Old 12-20-2011 , 16:52   Compile HELP!
Reply With Quote #1

Heey, please try to compile this sma file, if you can please say it, if you have edit something in the file, please say what you have edited.


#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < hamsandwich >
#include < fun >
#include < fakemeta >

public plugin_init() {
register_clcmd("say /shop","Menu2");
}

public Menu2(id) {
new menu = menu_create( "\rSHOP! Tobias:", "menu_handler");
menu_additem(menu, "\r#1 \wAK47!", "1", 0);
menu_additem(menu, "\r#2 \wM4A1!", "2", 0);
menu_additem(menu, "\r#3 \wAWP!", "3", 0);
menu_additem(menu, "\r#4 \wDEAGLE!", "4", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}

public menu_handler(id, menu, item){
if (item == MENU_EXIT)
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}

new data[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,charsmax(data), szName, charsmax(szName), callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
client_print(id, print_chat, "NICE! You choosed AK47!");
cs_set_user_money ( id, cs_get_user_money ( id ) - 5000 )
cs_set_weapon_ammo ( give_item ( id, "weapon_ak47" ), 90 )
}
case 2:
{
client_print(id, print_chat, "NICE! You choosed M4A1!");
cs_set_user_money ( id, cs_get_user_money ( id ) - 5000 )
cs_set_weapon_ammo ( give_item ( id, "weapon_m4a1" ), 90 )
}
case 3:
{
client_print(id, print_chat, "NICE! You choosed AWP!");
cs_set_user_money ( id, cs_get_user_money ( id ) - 10000 )
cs_set_weapon_ammo ( give_item ( id, "weapon_awp" ), 30 )
}
case 4:
{
client_print(id, print_chat, "NICE! You choosed DEAGLE!")
cs_set_user_money ( id, cs_get_user_money ( id ) - 3500
cs_set_weapon_ammo ( give_item ( id, "weapon_deagle" ), 7 )
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
tobbiass is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-20-2011 , 17:29   Re: Compile HELP!
Reply With Quote #2

  1. Don't make a new thread for the same thing. Post it in your old one.
  2. You need to look at how it's done in the code that was given to you in your other thread. If you follow that format you wouldn't be having issues.
  3. Also, every opening brace, bracket, parenthesis needs to have a closing brace, bracket, parenthesis.
__________________
fysiks is offline
tobbiass
Junior Member
Join Date: Dec 2011
Old 12-20-2011 , 17:34   Re: Compile HELP!
Reply With Quote #3

Where can i found the old one?
tobbiass is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-20-2011 , 17:38   Re: Compile HELP!
Reply With Quote #4

Quote:
Originally Posted by tobbiass View Post
Where can i found the old one?
How can you not find it?

Go to your profile. Go to your "Statistics". Click on "Find all threads started by tobbiass"
__________________

Last edited by fysiks; 12-20-2011 at 17:40.
fysiks is offline
tobbiass
Junior Member
Join Date: Dec 2011
Old 12-20-2011 , 17:41   Re: Compile HELP!
Reply With Quote #5

thanks
tobbiass is offline
tobbiass
Junior Member
Join Date: Dec 2011
Old 12-20-2011 , 17:44   Re: Compile HELP!
Reply With Quote #6

But it still didnt work.. The old one didnt work too
It say: <59> error 002: only a single statement or expression can follow each "case"
Warning 215: expression has no effect?
WTF? What shall i do?
tobbiass is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-20-2011 , 17:50   Re: Compile HELP!
Reply With Quote #7

Quote:
Originally Posted by tobbiass View Post
But it still didnt work.. The old one didnt work too
It say: <59> error 002: only a single statement or expression can follow each "case"
Warning 215: expression has no effect?
WTF? What shall i do?
Because you didn't start with the one that already compiled. It was posted for you. I will post it again here because it had extremely poor formatting. So, start with this one and and more stuff. Follow the format that you see there.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <fakemeta>

public plugin_init()
{
    
register_clcmd("say /shop","Menu2");
}

public 
Menu2(id)
{
    new 
menu menu_create"\rSHOP! Tobias:""menu_handler");
    
menu_additem(menu"\r#1 \wAK47!""1"0);
    
menu_additem(menu"\r#2 \wM4A1""2"0);
    
menu_additem(menu"\r#3 \wAWP""3"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
menu_handler(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szNamecharsmax(szName), callback);
    new 
key str_to_num(data);
    switch(
key)
    {
        case 
1:
        {
            
client_print(idprint_chat"NICE! You choosed AK47!");
            
cs_set_user_money idcs_get_user_money id ) - 5000 )
            
cs_set_weapon_ammo give_item id"weapon_ak47" ), 90 )
        }
        case 
2:
        {
            
client_print(idprint_chat"NICE! You choosed M4A1!");
            
cs_set_user_money idcs_get_user_money id ) - 5000 )
            
cs_set_weapon_ammo give_item id"weapon_m4a1" ), 90 )
        }
        case 
3:
        {
            
client_print(idprint_chat"NICE! You choosed AWP!");
            
cs_set_user_money idcs_get_user_money id ) - 10000 )
            
cs_set_weapon_ammo give_item id"weapon_awp" ), 30 )
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED

Also, when posting code, use [php][/php] around your code.
__________________

Last edited by fysiks; 12-20-2011 at 17:51.
fysiks 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 11:46.


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