Raised This Month: $32 Target: $400
 8% 

i want set cost for plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 03-21-2019 , 03:31   i want set cost for plugin
Reply With Quote #1

Hi all . i want set cost this plugin . gun tornado = 10000 gun nabodgar = 16000

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

public plugin_init() 

    
register_plugin("My Menu""1.0""Me"); 
    
register_clcmd("say /vmenu""ShowMenu"); 
    
register_clcmd("say /vmenu""ShowMenu"); 
    
register_concmd("say /vmenu""ShowMenu" ADMIN_RESERVATION ); 
     


public 
ShowMenu(id

    new 
menu menu_create("PubLic Menu By @Thew_ConFIger :""MohammadHlwani"); 

    
menu_additem(menu"\r[\yTorNado\r] \r[\y10000\r]" "" 1); // case 0 
    
menu_additem(menu"\r[\yNaboDGar\r] \r[\y16000\r]" "" 1); // case 1 

    
menu_setprop(menuMPROP_EXITMEXIT_ALL); 
    
    
menu_display(idmenu0); 

    return 
PLUGIN_HANDLED


public 
MohammadHlwani(idmenuitem

    if(
item == MENU_EXIT
    { 
        
menu_cancel(id); 
        return 
PLUGIN_HANDLED
    } 

    new 
command[6], name[64], accesscallback

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback); 

    switch(
item
    { 
        case 
0client_cmd(id"tornado");
        case 
1client_cmd(id"say /link");
    } 


    
menu_destroy(menu); 

    return 
PLUGIN_HANDLED

Mikaeel123 is offline
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 03-21-2019 , 03:36   Re: i want set cost for plugin
Reply With Quote #2

Please post the tornado and nabodgar plugins links or sma files.

Last edited by Moody92; 03-21-2019 at 03:36.
Moody92 is offline
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 03-21-2019 , 03:37   Re: i want set cost for plugin
Reply With Quote #3

https://gamebanana.com/gamefiles/6957
https://gamebanana.com/gamefiles/4412
i set the magic menu for this plugins

Last edited by Mikaeel123; 03-21-2019 at 03:38.
Mikaeel123 is offline
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 03-21-2019 , 03:53   Re: i want set cost for plugin
Reply With Quote #4

Quote:
Originally Posted by Mikaeel123 View Post
The link gun plugin doesn't have a .sma file, you may not set a cost to it.


You can only set a cost to the tornado weapon.
Moody92 is offline
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 03-21-2019 , 04:09   Re: i want set cost for plugin
Reply With Quote #5

Instead link gun set this plugin
https://gamebanana.com/gamefiles/7315
Mikaeel123 is offline
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 03-21-2019 , 05:57   Re: i want set cost for plugin
Reply With Quote #6

New cvars
Code:
tornado_price Default:10000
despe_price Default:10000
PHP Code:
#include <amxmodx>  
#include <amxmisc>  
#include <cstrike>  

new tornado_price
new dese_price
new etornado
new edese


public plugin_init()  
{  
    
register_plugin("My Menu""1.0""Me");  
    
    
register_clcmd("say /vmenu""ShowMenu");
    
    
tornado_price register_cvar("tornado_price""10000")
    
dese_price register_cvar("despe_price""10000")
    
}  

public 
ShowMenu(id)  
{  
    new 
menu menu_create("PubLic Menu By @Thew_ConFIger :""MohammadHlwani");  
    
    new 
tornado[32]
    new 
dese[32]
    
    
etornado cs_get_user_money(id) >= get_pcvar_num(tornado_price)
    
edese cs_get_user_money(id) >= get_pcvar_num(dese_price)
    
    
format(tornadocharsmax(tornado), etornado "\r[\yTorNado\r] \r[\y$%d\r]" "\r[\dTorNado\r] \r[\d$%d\r]"get_pcvar_num(tornado_price))
    
format(desecharsmax(dese), edese "\r[\yDespe\r] \r[\y$%d\r]" "\r[\dDespe\r] \r[\d$%d\r]"get_pcvar_num(dese_price))

    
menu_additem(menutornado ""ADMIN_RESERVATION ); // case 0  
    
menu_additem(menudese ""ADMIN_RESERVATION); // case 1  
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);  
    
    
menu_display(idmenu0);  
    
    return 
PLUGIN_HANDLED;  
}  

public 
MohammadHlwani(idmenuitem)  
{  
    if(
item == MENU_EXIT)  
    {  
        
menu_cancel(id);  
        return 
PLUGIN_HANDLED;  
    }  

    new 
command[6], name[64], accesscallback;  
    
    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);  

    
    switch(
item)  
    {  
        case 
0
        {
            if(
etornado){
                
cs_set_user_money(idcs_get_user_money(id) - get_pcvar_num(tornado_price))
                
client_print(idprint_chat"* [AMXX] You have bought the tornado gun.")
                
callfunc_begin("give_weapon""tornado.amxx")
                
callfunc_push_int(id)
                
callfunc_end()
            }
            else{
                
menu_display(idmenu0);  
                return 
PLUGIN_HANDLED
            
}
        }
        case 
1
        {
            if(
edese){
                
cs_set_user_money(idcs_get_user_money(id) - get_pcvar_num(dese_price))
                
client_print(idprint_chat"* [AMXX] You have bought the desperado gun.")
                
callfunc_begin("Get_Despe""despe.amxx")
                
callfunc_push_int(id)
                
callfunc_end()
            }
            else{
                
menu_display(idmenu0);
                return 
PLUGIN_HANDLED
            
}
        }
}  


    
menu_destroy(menu);  

    return 
PLUGIN_HANDLED;  

I have attached tornado.sma, and despe.sma. Only removed the clcmds attached to the weapons.

EDIT: Fyi, any player can use the menu without admin access. I got confused with your register_clcmd's.
EDIT2: I might be able to add the link gun, PM me if you still want that.
Attached Files
File Type: sma Get Plugin or Get Source (despe.sma - 238 views - 23.8 KB)
File Type: sma Get Plugin or Get Source (tornado.sma - 231 views - 13.3 KB)

Last edited by Moody92; 03-21-2019 at 20:05.
Moody92 is offline
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 03-21-2019 , 09:08   Re: i want set cost for plugin
Reply With Quote #7

Ty but
i want only vips flag b have this menu . i dont want players can buy

Last edited by Mikaeel123; 03-21-2019 at 09:08.
Mikaeel123 is offline
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 03-21-2019 , 20:06   Re: i want set cost for plugin
Reply With Quote #8

Quote:
Originally Posted by Mikaeel123 View Post
Ty but
i want only vips flag b have this menu . i dont want players can buy
Added. People without ADMIN_RESERVATION won't be able to click on the items in the menu.

You still need the modified despe.sma and tornado.sma. Otherwise, anyone can type tornado and despe in console and get the weapons for free and without requiring access.

Last edited by Moody92; 03-21-2019 at 20:46.
Moody92 is offline
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 03-22-2019 , 07:18   Re: i want set cost for plugin
Reply With Quote #9

Ok Thanks so much for help
Mikaeel123 is offline
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 03-27-2019 , 12:22   Re: i want set cost for plugin
Reply With Quote #10

Hi again . i want set cost again . how do you do this ??

rr700 = 10k cost
nce = 10k cost

link rr700= https://gamebanana.com/dl/367689
link nce= https://gamebanana.com/dl/385605

You can do this and teach me pls ?? how you do edit weapon files and menu ?
Mikaeel123 is offline
Reply


Thread Tools
Display Modes

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 12:53.


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