AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Custom text field? (https://forums.alliedmods.net/showthread.php?t=156723)

ZombieBot 05-11-2011 02:45

Custom text field?
 
Hi,

how i can make custom chat field? Like amx_banmenu custom reason?

Thx


(sry for my ban english)

bye =)

lis_16 05-11-2011 04:55

Re: Custom text field?
 
You want a special plugin or just a filed to enter fe. interp?

SonicSonedit 05-11-2011 06:50

Re: Custom text field?
 
ZombieBot
What exactly do you want?

cFG 05-11-2011 09:59

Re: Custom text field?
 
for ex.
Code:

bind "." "messagemode amx_ban"
- now you have to enter the player name, ban lenght, reason and push enter
same as if you'll type it through the console but without the amx_ban prefix

This is it?

Hunter-Digital 05-11-2011 10:06

Re: Custom text field?
 
"Custom text field" like you'd type into say but you actually type in a command ?

You just create a console command, example "CustomReason" and when you send your ban command or whatever, send cmd to client: "messagemode CustomReason", that'll show the user "CustomReason: " in top left corner of screen and he can type something there.

Then you just get the input client typed in CustomReason's callback function, I recommend using read_args() instead of read_argv() if you have only one long string that could contain other double quotes... anyway, just use read_args() :P

Simple.

fysiks 05-11-2011 22:45

Re: Custom text field?
 
Quote:

Originally Posted by cFG (Post 1467455)
for ex.
Code:

bind "." "messagemode amx_ban"
- now you have to enter the player name, ban lenght, reason and push enter
same as if you'll type it through the console but without the amx_ban prefix

This is it?

That doesn't work because the whole line of text you type will be interpreted at a single argument (the player name).

ZombieBot 05-12-2011 01:51

Re: Custom text field?
 
Quote:

Originally Posted by Hunter-Digital (Post 1467457)
"Custom text field" like you'd type into say but you actually type in a command ?

You just create a console command, example "CustomReason" and when you send your ban command or whatever, send cmd to client: "messagemode CustomReason", that'll show the user "CustomReason: " in top left corner of screen and he can type something there.

Then you just get the input client typed in CustomReason's callback function, I recommend using read_args() instead of read_argv() if you have only one long string that could contain other double quotes... anyway, just use read_args() :P

Simple.

Thx SO MUCH! :)

fysiks 05-12-2011 18:46

Re: Custom text field?
 
You can look at AMX SSBans plugin by Dorin. I did this in his plugin.


All times are GMT -4. The time now is 04:29.

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