Raised This Month: $ Target: $400
 0% 

Save 2 arrays?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
KuvZz
Member
Join Date: Sep 2013
Location: Spain
Old 09-30-2014 , 08:11   Save 2 arrays?
Reply With Quote #1

Hi guys. I have this and works
PHP Code:
//#includes...
new g_Weapon[33]

enum
{
    
NO_WEAPON 0,
    
AK,
    
M4
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""fwd_Spawn"1)
    
    
register_clcmd("say /test""test")
}

public 
client_putinserver(id)
{
    
g_Weapon[id] = NO_WEAPON
}

public 
fwd_Spawn(id)
{
    if (
g_Weapon[id] == NO_WEAPON) return;
    
    if (
g_Weapon[id] == AK)
    {
        
give_item(id"weapon_ak47")
    }
    else if (
g_Weapon[id] == M4)
    {
        
give_item(id"weapon_m4a1")
    }
}

public 
test(id)
{
    new 
menu menu_create("Choose a weapon""items")
    
menu_additem(menu"AK47""0")
    
menu_additem(menu"M4A1""1")
    
    
menu_display(idmenu0)
    return 
PLUGIN_HANDLED
}

public 
items(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    switch (
item)
    {
        case 
0:
        {
            
g_Weapon[id] = AK //Next round you'll get an AK47
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
        
}
        case 
1:
        {
            
g_Weapon[id] = M4A1 //Next round you'll get a M4A1
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_HANDLED

but I only can choose one of them, what I should do to choose 2, 3 or more arrays?
Ty for help^^
__________________

Last edited by KuvZz; 09-30-2014 at 14:27.
KuvZz 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 17:35.


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