Raised This Month: $ Target: $400
 0% 

get msg of a player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-27-2008 , 23:57   get msg of a player
Reply With Quote #1

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
Alucard^ is offline
Send a message via Skype™ to Alucard^
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 07-28-2008 , 00:08   Re: get msg of a player
Reply With Quote #2

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
__________________
IneedHelp is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-28-2008 , 00:15   Re: get msg of a player
Reply With Quote #3

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");     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-28-2008 , 00:19   Re: get msg of a player
Reply With Quote #4

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
Alucard^ is offline
Send a message via Skype™ to Alucard^
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-28-2008 , 00:49   Re: get msg of a player
Reply With Quote #5

You don't have to use 192.
I just used 192 because that is the maximum amount for a message.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
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 05:28.


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