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

[SOLVED] Save weapons menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 06-28-2014 , 09:05   [SOLVED] Save weapons menu
Reply With Quote #1

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 . !

Last edited by Freezo Begin; 06-28-2014 at 13:15.
Freezo Begin is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 06-28-2014 , 10:22   Re: Save weapons menu
Reply With Quote #2

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
__________________

Last edited by Eagle07; 06-28-2014 at 10:24.
Eagle07 is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 06-28-2014 , 10:33   Re: Save weapons menu
Reply With Quote #3

No this will show the menu of the weapons . i wan't if he select save next round will get the last weapons
Freezo Begin is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-28-2014 , 10:55   Re: Save weapons menu
Reply With Quote #4

Save the user's weapon into a global variable, and when you want to set it, just use the variable.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 06-28-2014 , 12:54   Re: Save weapons menu
Reply With Quote #5

Really Thanks guys Flick3rR & Eagle !

Last edited by Freezo Begin; 06-28-2014 at 12:54.
Freezo Begin is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-28-2014 , 12:56   Re: Save weapons menu
Reply With Quote #6

If the problem is solved, you may add [SOLVED] in the title.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
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 04:02.


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