This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

How to create one input chat to insert only numbers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
polimpo4
Member
Join Date: Jan 2017
Old 04-28-2018 , 15:51   How to create one input chat to insert only numbers
Reply With Quote #1

How to create one input chat to insert name or number.

Like if i need to make one plugin to send money or something else relative with quantity to somone.

It would be great if someone give one example to set chat input to insert any amount or quantity as player wish... and if you guys know how to set one menu to select one player from all players from server.

Like i want send X amout of money to Y player i say the command like /send and show to me one menu to select which player i want to send it and than it shows me one input chat to write the amount of money to send.

Last edited by polimpo4; 04-28-2018 at 15:56.
polimpo4 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-28-2018 , 16:04   Re: How to create one input chat to insert only numbers
Reply With Quote #2

1st you need to register_clcmd input_amount

Then send clcmd messagemode input_amount

Retrieve the arguments in the input_money function.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-28-2018 at 16:06.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
polimpo4
Member
Join Date: Jan 2017
Old 04-28-2018 , 16:06   Re: How to create one input chat to insert only numbers
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
1st you need to register_clcmd input_amount

Then send clcmd messagemode input_amount

Retrieve the arguments in the input_money function.
How i made that function input_amount?
polimpo4 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-28-2018 , 16:13   Re: How to create one input chat to insert only numbers
Reply With Quote #4

Here is a demonstration


PHP Code:
public plugin_init()
{
      
register_clcmd("say /send""clcmd_send");
      
register_clcmd("input_amount""clcmd_inputamount");
}


public 
clcmd_send(idclient_cmd(id"messagemode input_amount");

public 
clcmd_inputamount(id)
{
          new 
args[32];
          
read_args(args 31);
          
remove_quotes(args);

          
client_print(idprint_chat"you tried to send %d"str_to_num(args));

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
polimpo4
Member
Join Date: Jan 2017
Old 04-28-2018 , 16:23   Re: How to create one input chat to insert only numbers
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
Here is a demonstration


PHP Code:
public plugin_init()
{
      
register_clcmd("say /send""clcmd_send");
      
register_clcmd("input_amount""clcmd_inputamount");
}


public 
clcmd_send(idclient_cmd(id"messagemode input_amount");

public 
clcmd_inputamount(id)
{
          new 
args[32];
          
read_args(args 31);
          
remove_quotes(args);

          
client_print(idprint_chat"you tried to send %d"str_to_num(args));



YOU ARE THE BEST!!!

Thanks

And how to get a list of players(like the list of players we get from amxmodmenu ban/kick option) to select to send amount? this 2 things will help me to do a lot of plugins and all thanks to you! I will name them with your name to honor you.

Last edited by polimpo4; 04-28-2018 at 16:24.
polimpo4 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-28-2018 , 16:26   Re: How to create one input chat to insert only numbers
Reply With Quote #6

Quote:
Originally Posted by polimpo4 View Post
YOU ARE THE BEST!!!

Thanks

And how to get a list of players(like the list of players we get from amxmodmenu ban/kick option) to select to send amount? this 2 things will help me to do a lot of plugins and all thanks to you! I will name them with your name to honor you.
https://forums.alliedmods.net/showth...364#PlayerMenu
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 14:53.


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