AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Save weapons menu (https://forums.alliedmods.net/showthread.php?t=243007)

Freezo Begin 06-28-2014 09:05

[SOLVED] Save weapons menu
 
Hy again !! when i was creating a menu that show primary and secondary and ammo menu chooser . i was thinking to add a save weapon in menu by toggle that will "Save" or "Not" the last weapon choosing . so i try to do it by adding a bool and checking every weapon but it's so hard . if there's any other way to save last weapon . !

Eagle07 06-28-2014 10:22

Re: Save weapons menu
 
first !
PHP Code:

new bool:g_bsaveGuns33 

and
PHP Code:

public client_putinserverid 

    
g_bsaveGunsid ] = false



PHP Code:

public savemenuid )
{
    new 
menu menu_create("Save Weapons ?""savehandler")
        
menu_additem(menu"Yes""0")
        
menu_additem(menu"No""1")
        
menu_displayidmenu);
}
public 
savehandleridmenuiItem )
{
        if( 
iItem == MENU_EXIT )
        {
                
menu_destroymenu );
                return 
PLUGIN_HANDLED;
        }
        
        new 
szData];
        new 
iAccesshCallback;
        
        
menu_item_getinfomenuiItemiAccessszData5__hCallback );
    
        
        switch( 
str_to_numszData ) )
{
        case 
0: {
        
g_bsaveGunsid ] = true;
        
GiveWeaponsid ); /// Give Weapons Public 'replace it'
        
}
        case 
1: {
        return 
PLUGIN_HANDLED;
        }
}
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;



And Fix if you get any problem :)

Freezo Begin 06-28-2014 10:33

Re: Save weapons menu
 
No this will show the menu of the weapons . i wan't if he select save next round will get the last weapons

Flick3rR 06-28-2014 10:55

Re: Save weapons menu
 
Save the user's weapon into a global variable, and when you want to set it, just use the variable.

Freezo Begin 06-28-2014 12:54

Re: Save weapons menu
 
Really Thanks guys Flick3rR & Eagle !

Flick3rR 06-28-2014 12:56

Re: Save weapons menu
 
If the problem is solved, you may add [SOLVED] in the title.


All times are GMT -4. The time now is 21:16.

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