AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get msg of a player (https://forums.alliedmods.net/showthread.php?t=74961)

Alucard^ 07-27-2008 23:57

get msg of a player
 
hi,

i need to get msg of the player and say something... but i not want to create a command...

example:

a player say "/a"

when the player say /a, a command is execute on the player "say /b"

Alucard^: /a
Alucard^: /b

thx

IneedHelp 07-28-2008 00:08

Re: get msg of a player
 
PHP Code:

[...]
register_clcmd("say""hooksay")

[...]

public 
hooksay(id)
{
 new 
args[32]
 
read_args(args31)

 if (
equal(args"/blablabla"))
 { 
   [...]
 }


This is one of the ways to check if player say something and then do other thing, but i don't understand this part:

Quote:

when the player say /a, a command is execute on the player "say /b"

Alucard^: /a
Alucard^: /b

thx

Exolent[jNr] 07-28-2008 00:15

Re: get msg of a player
 
Code:
#include <amxmodx> public plugin_init() {     register_clcmd("say", "CmdSay", -1, ""); } public CmdSay(plr) {     new message[192];     read_args(message, 191);     remove_quotes(message);         if( equali(message, "/a", 0) )     {         client_cmd(plr, "say /b");     } }

Alucard^ 07-28-2008 00:19

Re: get msg of a player
 
thx to much ineedhelp and x-olent

edit: oh, and a question..

Quote:

new message[192];
read_args(message, 191);
why 192, why not 32 or other?

thx

Exolent[jNr] 07-28-2008 00:49

Re: get msg of a player
 
You don't have to use 192.
I just used 192 because that is the maximum amount for a message.


All times are GMT -4. The time now is 05:28.

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