Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP] Choose the survivor weapon 2.0 [10/06/13]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-12-2009 , 15:59   Re: [ZP] Choose the weapons survivor 1.6
Reply With Quote #8

Code:
[de]
CHOOSE_WEAPON = Du hast gewaehlt:
CHOOSE_RANDOM_WEAPON = wurde zufaellig ausgewaehlt.
Example how you can do the menu handling much easier and readable:

PHP Code:
new const primaries[][] =
{
    
"weapon_m249",
    
"weapon_m4a1",
    
"weapon_ak47",
    
"weapon_mp5navy"
}

new const 
primarynames[][] =
{
    
"M249",
    
"M4A1",
    
"AK-47",
    
"MP5"
}

public 
mostrarmenu(id)
{
    new 
menu menu_create("\rChoose the weapon \yprimary \rsurvivor:""mostrar_cliente")
    
    
menu_additem(menu"\yM249""0"0)
    
menu_additem(menu"\yM4a1""1"0)
    
menu_additem(menu"\yAK47""2"0)
    
menu_additem(menu"\yMP5""3"0)
    
menu_additem(menu"\yRandom""4"0)
    
    
menu_display(idmenu0)
}

public 
mostrar_cliente(idmenuitem)
{
    new 
data[6], iName[2];
    new 
accesscallback;
    
menu_item_getinfomenuitemaccessdata,5iName1callback );
    new 
choice str_to_num(data);
    
    if( 
choice == )
        
choice random_num0);
    
    
drop_weaponsid);
    
fm_give_itemidprimaries[choice] );
    
client_printidprint_chat"[CWS] %L %s"id"CHOOSE_WEAPON"primarynames[choice] );
    
    if( 
get_pcvar_numpcvar_secondary ) )
        
mostrarmenu2id );
    
    
menu_destroymenu );
    
    return 
PLUGIN_HANDLED;

__________________
In Flames we trust!

Last edited by Nextra; 04-12-2009 at 16:08.
Nextra is offline
 



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 16:18.


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