Raised This Month: $ Target: $400
 0% 

BuyMenu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-11-2010 , 05:27   BuyMenu
Reply With Quote #1

How I can do a buy menu like /drshop.
I know how do a simple menu i need to know remove a Money .
zirualas is offline
Send a message via Skype™ to zirualas
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-11-2010 , 05:37   Re: BuyMenu
Reply With Quote #2

Quote:
Originally Posted by zirualas View Post
How I can do a buy menu like /drshop.
I know how do a simple menu i need to know remove a Money .
You need cstrike. #include cstrike

then use something like..

PHP Code:
new money cs_get_user_money(id)
cs_set_user_moneyidmoney 5000 
Replace the + sign with a - sign if you want to remove 5000$ from the player.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 08-11-2010 , 07:33   Re: BuyMenu
Reply With Quote #3

GX, remember about money bug...
PHP Code:
case //gravity
        
{
        if (
cs_get_user_money(id) < 1000){
        
get_user_name(idname31)
        
ColorChat(idGREEN"%s ^x03nie stac cie na to!"name//not enough money
        
return PLUGIN_HANDLED;
    }
        if (!
is_user_alive(id)){
        
ColorChat(idGREEN"%s ^x03musisz zyc mozgu!"name//need to be alive
        
return PLUGIN_HANDLED;
    }
        if (
cs_get_user_money(id) >= 1000 )
        
get_user_name(idname31)
        
ColorChat(0GREEN"%s ^x03wybral grawitacje 700!"name)//grav 700 bought
        
set_user_gravity(id0.87)                //gravity 700= 0.87
        
cs_set_user_money(id cs_get_user_money(id) - 10000)
    } 
Example from my very old never used plugin.
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-11-2010 , 08:23   Re: BuyMenu
Reply With Quote #4

What's problem?
PHP Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// testas.sma
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
3) : error 017undefined symbol "fun_menu"
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
3) : warning 215expression has no effect
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
3) : warning 215expression has no effect
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
3) : error 001expected token";"but found ")"
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
3) : error 029invalid expressionassumed zero
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
3) : fatal error 107too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
// Could not locate output file C:\Program Files\Counter-strike\cstrike\addons\a
mxmodx\scripting\compiled\testas.amx (compile failed).
//
// Compilation Time: 0.05 sec
// ----------------------------------------

Press enter to exit ... 
My code:
PHP Code:
#include <amxmodx>
#include <cstrike>

#define PLUGIN "Fun Buy"
#define VERSION "1.0"
#define AUTHOR "ZiruAl"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd"say /funbuy""FunBuy" );
    
register_clcmd"say_team /funbuy""FunBuy" );

}
public 
FunBuy(id)
{
    new 
menu menu_create("\gFun Buy Menu:""menu_handler");

    
menu_additem(menu"\w Low Gravity - \r4000""1"0);
    
menu_additem(menu"\w Low Gravity - \r4000""2"0);

    
menu_setprop(fun_menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0);
}
public 
menu_handler(idmenuitem);
{
    
ofitem == MENU_EXIT )
    {
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
    }
    new 
data[6], iName[64];
    new 
acvesscallback;

    
menu_item_getinfo(menuitemaccessdata,6iName63callback);
    
new_ key str_to_num(data);
    switch(
key)
    {
    case 
//gravity
        
{
            if (
cs_get_user_money(id) < 1000){
            
get_user_name(idname31)
            
ColorChat(idGREEN"%s ^x03Don't have enought money"name)
            return 
PLUGIN_HANDLED;
        }
            if (!
is_user_alive(id)){
            
ColorChat(idGREEN"%s ^x03need to be alive"name)
            return 
PLUGIN_HANDLED;
        }
            if (
cs_get_user_money(id) >= 1000 )
            
get_user_name(idname31)
            
ColorChat(0GREEN"%s ^x03Buy a gravitation"name)
            
set_user_gravity(id0.87)
            
cs_set_user_money(id cs_get_user_money(id) - 10000)
    }
        case 
2:
        {
            
client_print(idprint_chat"Testing..");
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 

Last edited by zirualas; 08-11-2010 at 08:25.
zirualas is offline
Send a message via Skype™ to zirualas
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-11-2010 , 08:33   Re: BuyMenu
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <colorchat>
#include <fun>

#define PLUGIN "Fun Buy"
#define VERSION "1.0"
#define AUTHOR "ZiruAl"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd"say /funbuy""FunBuy" );
    
register_clcmd"say_team /funbuy""FunBuy" );

}
public 
FunBuy(id)
{
    new 
menu menu_create("\gFun Buy Menu:""menu_handler");

    
menu_additem(menu"\w Low Gravity - \r4000""1"0);
    
menu_additem(menu"\w Low Gravity - \r4000""2"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], iName[64];
    new 
acesscallback;

    
menu_item_getinfo(menuitemacessdata,6iName63callback);
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
//gravity
        
{
            new 
name[32];
            
            if (
cs_get_user_money(id) < 1000)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 1000 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03Buy a gravitation"name)
                
set_user_gravity(id0.87)
                
cs_set_user_money(id cs_get_user_money(id) - 10000)
            }
        }
        
        case 
2:
        {
            
client_print(idprint_chat"Testing..");
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-11-2010 , 08:36   Re: BuyMenu
Reply With Quote #6

Oh! D I know i don't include <fun> D
zirualas is offline
Send a message via Skype™ to zirualas
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-11-2010 , 09:45   Re: BuyMenu
Reply With Quote #7

Sorry for double post but i have a problem (not scripting I guest)
I set item in buy menu that person can buy a C4 but then i plant 1 bomb and i bougt new bomb he's write you are nor in plant, when i drop the c4 and pickup i can set bomb. So how i can do when i buy bomb and I immediately plant the BOMB
zirualas is offline
Send a message via Skype™ to zirualas
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-11-2010 , 11:20   Re: BuyMenu
Reply With Quote #8

Quote:
Originally Posted by zirualas View Post
Sorry for double post but i have a problem (not scripting I guest)
I set item in buy menu that person can buy a C4 but then i plant 1 bomb and i bougt new bomb he's write you are nor in plant, when i drop the c4 and pickup i can set bomb. So how i can do when i buy bomb and I immediately plant the BOMB
You have to download porn. Go to google, and look for uTorrent, download it. Then search for "Gay Hairy Porn Torrents", after it's downloaded, you can successfully plant the bomb.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-11-2010 , 11:40   Re: BuyMenu
Reply With Quote #9

Whow you realy wath thees videos? I don't like if you like it you can watch ;)
zirualas is offline
Send a message via Skype™ to zirualas
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-11-2010 , 15:40   Re: BuyMenu
Reply With Quote #10

cs_set_user_plant()
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 21:55.


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