AlliedModders

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

umarsa 12-17-2006 19:22

Message Mode
 
Code:

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_clcmd("test", "test")
}

public test(id)
{
        //  client has to do command "messagemode test" has to be same as the public function
        new message[192]
        // Get message and remove quotes
        read_args(message, 191)
        remove_quotes(message)       
        client_print(id, print_chat, "You Typed: ^"%s^"", message)
        return PLUGIN_HANDLED
}

Now do i make it so when they type "amx_test" in their console it will make a messagemode come and after they have typed their message it will print_chat in the clients chat area?

stupok 12-17-2006 22:40

Re: Message Mode
 
I can't decipher what you are asking exactly...

If the client binds a key to "messagemode test" and pushes the key, they will see a prompt in the upper-left hand corner that says "test:". They can type whatever message they want, push enter, and it will display only to them: "You typed: "blahblahblahblah"".


If you want the client to simply bind a key to amx_test, and see the "test:" prompt in the upper-left when the key is pushed, add the following to your existing code.

Code:
register_clcmd("amx_test", "test_function") public test_function(id) {     client_cmd(id, "messagemode test") }

dutchmeat 12-18-2006 04:20

Re: Message Mode
 
Command:
test: Show hudtext "Special Message Mode", execute the original 'say' command

Forward: Say, return and print it in clientprint ? or whatever you want to do with it.

umarsa 12-18-2006 05:01

Re: Message Mode
 
I found out how to do it.


All times are GMT -4. The time now is 06:56.

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