AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Message Help (https://forums.alliedmods.net/showthread.php?t=292926)

Awesome_man 01-18-2017 03:49

Message Help
 
Code:

case 1:
        {
                new arg[32]
                new text[70]
                read_args(text, sizeof(text) - 1);
                remove_quotes(text);
                parse(text, arg, sizeof(arg) - 1);
               
                if(isdigit(arg[0]))
                {
                        new amount = str_to_num(arg)
                        if (amount <= 0)
                        {
                                zp_colored_print(id, "^x04[ZP BANK] ^x01Successfully Deposited %d Ammo Packs In Bank",amount);
                               
                                return PLUGIN_CONTINUE;
                        }
                        store_packs(id, amount);
                       
                        return PLUGIN_HANDLED;

I made a menu for this plugin it's working fine except the manual amount to be deposited, How to do that using messagemod ? Thanks

Craxor 01-18-2017 05:07

Re: Message Help
 
Code:
            if (amount <= 0)             {                 zp_colored_print(id, "^x04[ZP BANK] ^x01Successfully Deposited %d Ammo Packs In Bank",amount);                                 return PLUGIN_CONTINUE;             }             store_packs(id, amount);

- >
Code:
            if (amount)             {                 zp_colored_print(id, "^x04[ZP BANK] ^x01Successfully Deposited %d Ammo Packs In Bank",amount);                 store_packs( id , amount );                 return PLUGIN_CONTINUE;             }

edon1337 01-18-2017 05:42

Re: Message Help
 
PHP Code:

            if (amount >= 0)
            {
                
zp_colored_print(id"^x04[ZP BANK] ^x01Successfully Deposited %d Ammo Packs In Bank",amount);
                
store_packsid amount );
            } 


Awesome_man 01-18-2017 05:55

Re: Message Help
 
Quote:

Originally Posted by edon1337 (Post 2487655)
PHP Code:

            if (amount >= 0)
            {
                
zp_colored_print(id"^x04[ZP BANK] ^x01Successfully Deposited %d Ammo Packs In Bank",amount);
                
store_packsid amount );
            } 


Ya my bad i forgot this but how to pass value while selection the menu ? That's my original post. Thanks

edon1337 01-18-2017 06:57

Re: Message Help
 
What value ? Where to pass it?

Awesome_man 01-18-2017 09:44

Re: Message Help
 
Quote:

Originally Posted by edon1337 (Post 2487668)
What value ? Where to pass it?

Actually i want whenever i press the menu button for my case 1 it should take value as a input to be entered by user(amount) how to do that ?

Craxor 01-18-2017 10:17

Re: Message Help
 
still doesn't make any sense, when he choose case 1 what to happen ?

edon1337 01-18-2017 11:32

Re: Message Help
 
Quote:

Originally Posted by Awesome_man (Post 2487705)
it should take value as a input to be entered by user(amount)

Huh ? Please try explaining in a more detailed way. Do you want a withdraw option ?

MaXs 01-18-2017 12:16

Re: Message Help
 
He probably mean when you click 1 its says in chat that you need to set value how much to put

edon1337 01-18-2017 13:28

Re: Message Help
 
Quote:

Originally Posted by MaXs (Post 2487754)
He probably mean when you click 1 its says in chat that you need to set value how much to put

That's basically what I just said, withdraw option.

You can do that by using read_args


All times are GMT -4. The time now is 22:34.

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