Raised This Month: $51 Target: $400
 12% 

[SOLVED]Execute conCmd by menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zaidbt
Senior Member
Join Date: Jun 2014
Location: Morroco
Old 07-07-2015 , 18:07   [SOLVED]Execute conCmd by menu
Reply With Quote #1

Hi guys ,

i'm trying to create a new Vip Menu , I want that at Sec : 15 a menu appears , untill here all good
how to execute a Concmd if player chose one of the options in menu ?
PHP Code:
register_concmd("amx_sw_m4""hook_concmd_sw_m4",ADMIN_IMMUNITY"{<#playerindex|name(can be partial)> <g(means give M4A1/W M203)|s(means strip target's superweapon if he has>}"
I Want that when he chose Case 0 for exemple , server execute this cmd
PHP Code:
amx_sw_m4 id(playergive 
i have done this :
PHP Code:
public_weapon
{
new 
menu menu_create"Class menu""menu_handler" )     
    
    
menu_additemmenu"SW M4""");  
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL )          
    
menu_displayidmenu
    
}     

public 
menu_handleridmenuitem )     
{        


    if(
item == MENU_EXIT)
        return 
PLUGIN_HANDLED;

    
    switch( 
item )     
    {     
        case 
0:     
        {     
    
//////////// here //////////
        

Ty
__________________
http://steamcommunity.com/profiles/76561198044821965
=========Working On Naruto Mod========
Zaidbt is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 07-07-2015 , 22:53   Re: Execute conCmd by menu
Reply With Quote #2

PHP Code:
server_cmd("amx_sw_m4 %s give"id
__________________
Shiina.Mashiro is offline
Zaidbt
Senior Member
Join Date: Jun 2014
Location: Morroco
Old 07-08-2015 , 00:04   Re: Execute conCmd by menu
Reply With Quote #3

Quote:
Originally Posted by Shiina.Mashiro View Post
PHP Code:
server_cmd("amx_sw_m4 %s give"id
Works also with
PHP Code:
 new szName[32]
                  
get_user_nameid szName charsmax szName ) ) 

                  
client_cmd(id,"amx_sw_m4 ^"%s^" give"szName
Ty shiira
__________________
http://steamcommunity.com/profiles/76561198044821965
=========Working On Naruto Mod========
Zaidbt is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 07-08-2015 , 08:08   Re: Execute conCmd by menu
Reply With Quote #4

Quote:
Originally Posted by Zaidbt View Post
Works also with
PHP Code:
 new szName[32]
                  
get_user_nameid szName charsmax szName ) ) 

                  
client_cmd(id,"amx_sw_m4 ^"%s^" give"szName
Ty shiira
You don't need to get target's name to do that.
Btw the "amx_sw_m4" command is allowed for all client? lol
__________________
Shiina.Mashiro is offline
Zaidbt
Senior Member
Join Date: Jun 2014
Location: Morroco
Old 07-08-2015 , 19:50   Re: [SOLVED]Execute conCmd by menu
Reply With Quote #5

The CMD is actually is "amx_sw_m4 id Give" , I Edited The Flag to ADMIN_LEVEL_H ; It didnt work with your method xD
__________________
http://steamcommunity.com/profiles/76561198044821965
=========Working On Naruto Mod========
Zaidbt is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 07-09-2015 , 01:15   Re: [SOLVED]Execute conCmd by menu
Reply With Quote #6

Quote:
Originally Posted by Zaidbt View Post
The CMD is actually is "amx_sw_m4 id Give" , I Edited The Flag to ADMIN_LEVEL_H ; It didnt work with your method xD
yep it will work, I didn't see anything wrong about my code.
And about your code, the amx_sw_m4 is allowed for ADMIN_IMMUNITY, so if the player don't have that flag, they can't execute the command.
__________________
Shiina.Mashiro is offline
Zaidbt
Senior Member
Join Date: Jun 2014
Location: Morroco
Old 07-09-2015 , 01:22   Re: [SOLVED]Execute conCmd by menu
Reply With Quote #7

What if , I Changed it TO ADMIN_LEVEL_H ? ( VIP )
__________________
http://steamcommunity.com/profiles/76561198044821965
=========Working On Naruto Mod========
Zaidbt is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 07-09-2015 , 03:00   Re: [SOLVED]Execute conCmd by menu
Reply With Quote #8

then changed na why tell us xD
indraraj striker is offline
Zaidbt
Senior Member
Join Date: Jun 2014
Location: Morroco
Old 07-09-2015 , 07:34   Re: [SOLVED]Execute conCmd by menu
Reply With Quote #9

Hahah , its already solved
__________________
http://steamcommunity.com/profiles/76561198044821965
=========Working On Naruto Mod========
Zaidbt 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 15:59.


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